3 * Tests for Special:Uncategorizedcategories
5 class UncategorizedCategoriesPageTest
extends MediaWikiTestCase
{
7 * @dataProvider provideTestGetQueryInfoData
8 * @covers UncategorizedCategoriesPage::getQueryInfo
10 public function testGetQueryInfo( $msgContent, $expected ) {
11 $msg = new RawMessage( $msgContent );
12 $mockContext = $this->getMockBuilder( RequestContext
::class )->getMock();
13 $mockContext->method( 'msg' )->willReturn( $msg );
14 $special = new UncategorizedCategoriesPage();
15 $special->setContext( $mockContext );
16 $this->assertEquals( [
22 'namespace' => 'page_namespace',
23 'title' => 'page_title',
24 'value' => 'page_title',
27 0 => 'cl_from IS NULL',
28 'page_namespace' => 14,
29 'page_is_redirect' => 0,
34 1 => 'cl_from = page_id',
37 ], $special->getQueryInfo() );
40 public function provideTestGetQueryInfoData() {
43 "* Stubs\n* Test\n* *\n* * test123",
44 [ 1 => "page_title not in ( 'Stubs','Test','*','*_test123' )" ]
47 "Stubs\n* Test\n* *\n* * test123",
48 [ 1 => "page_title not in ( 'Test','*','*_test123' )" ]
51 "* StubsTest\n* *\n* * test123",
52 [ 1 => "page_title not in ( 'StubsTest','*','*_test123' )" ]
57 [ "Test\n*Test2", [ 1 => "page_title not in ( 'Test2' )" ] ],
59 [ "*Test\nTest2", [ 1 => "page_title not in ( 'Test' )" ] ],
60 [ "Test\nTest2", [] ],