9 use MediaWikiCoversValidator;
12 $resultWrapper = $this->getMockBuilder( Wikimedia\Rdbms\ResultWrapper::class )
13 ->disableOriginalConstructor();
15 $resultWrapper = $resultWrapper->getMock();
16 $resultWrapper->expects( $this->atLeastOnce() )
18 ->will( $this->returnValue( $row ) );
19 $resultWrapper->expects( $this->
any() )
21 ->will( $this->returnValue( $numRows ) );
23 return $resultWrapper;
27 $row =
new stdClass();
28 $row->page_namespace = $namespace;
46 $this->assertEquals( $resultWrapper, $object->res );
47 $this->assertSame( 0, $object->key );
48 $this->assertEquals( $row, $object->current );
62 $this->assertEquals( $resultWrapper, $object->res );
63 $this->assertSame( 0, $object->key );
64 $this->assertInstanceOf( Title::class, $object->current );
65 $this->assertEquals( $namespace, $object->current->mNamespace );
66 $this->assertEquals( $title, $object->current->mTextform );
86 $this->assertEquals( $numRows, $object->count() );
97 $this->assertInstanceOf( Title::class, $object->current() );
98 $this->assertEquals( $namespace, $object->current->mNamespace );
99 $this->assertEquals( $title, $object->current->mTextform );
115 $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
testConstructionWithFalseRow()
TitleArrayFromResult::__construct.
testValid( $input, $expected)
provideTestValid TitleArrayFromResult::valid
testConstructionWithRow()
TitleArrayFromResult::__construct.
testCurrentAfterConstruction()
TitleArrayFromResult::current.
getRowWithTitle( $namespace=3, $title='foo')
testCountWithVaryingValues( $numRows)
provideNumberOfRows TitleArrayFromResult::count
getTitleArrayFromResult( $resultWrapper)
static provideNumberOfRows()
getMockResultWrapper( $row=null, $numRows=1)
namespace and then decline to actually register it file or subcat img or subcat $title
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
processing should stop and the error should be shown to the user * false
if(is_array($mode)) switch( $mode) $input