10 $resultWrapper = $this->getMockBuilder(
'ResultWrapper' )
11 ->disableOriginalConstructor();
13 $resultWrapper = $resultWrapper->getMock();
14 $resultWrapper->expects( $this->atLeastOnce() )
16 ->will( $this->returnValue( $row ) );
17 $resultWrapper->expects( $this->any() )
19 ->will( $this->returnValue( $numRows ) );
21 return $resultWrapper;
25 $row =
new stdClass();
26 $row->user_name = $username;
43 $this->assertEquals( $resultWrapper, $object->res );
44 $this->assertSame( 0, $object->key );
45 $this->assertEquals( $row, $object->current );
52 $username =
'addshore';
58 $this->assertEquals( $resultWrapper, $object->res );
59 $this->assertSame( 0, $object->key );
60 $this->assertInstanceOf(
'User', $object->current );
61 $this->assertEquals( $username, $object->current->mName );
78 $this->assertEquals( $numRows, $object->count() );
85 $username =
'addshore';
88 $this->assertInstanceOf(
'User', $object->current() );
89 $this->assertEquals( $username, $object->current()->mName );
95 array(
false,
false ),
105 $this->assertEquals( $expected, $object->valid() );