10 $resultWrapper = $this->getMockBuilder(
Wikimedia\Rdbms\ResultWrapper::class )
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();
43 $this->assertEquals( $resultWrapper, $object->res );
44 $this->assertSame( 0, $object->key );
45 $this->assertEquals( $row, $object->current );
58 $this->assertEquals( $resultWrapper, $object->res );
59 $this->assertSame( 0, $object->key );
60 $this->assertInstanceOf( User::class, $object->current );
61 $this->assertEquals(
$username, $object->current->mName );
81 $this->assertEquals( $numRows, $object->count() );
91 $this->assertInstanceOf( User::class, $object->current() );
92 $this->assertEquals(
$username, $object->current()->mName );
108 $this->assertEquals( $expected, $object->valid() );
they could even be mouse clicks or menu items whatever suits your program You should also get your if any
testCurrentAfterConstruction()
UserArrayFromResult::current.
getMockResultWrapper( $row=null, $numRows=1)
static provideNumberOfRows()
testConstructionWithFalseRow()
UserArrayFromResult::__construct.
testValid( $input, $expected)
provideTestValid UserArrayFromResult::valid
testCountWithVaryingValues( $numRows)
provideNumberOfRows UserArrayFromResult::count
getUserArrayFromResult( $resultWrapper)
testConstructionWithRow()
UserArrayFromResult::__construct.
getRowWithUsername( $username='fooUser')
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
this hook is for auditing only or null if authentication failed before getting that far $username
processing should stop and the error should be shown to the user * false
if(is_array($mode)) switch( $mode) $input