From: Kunal Mehta Date: Wed, 30 Jan 2019 05:35:52 +0000 (-0800) Subject: Rename UncategorizedCategoriesPageTest to match class name X-Git-Tag: 1.34.0-rc.0~2992 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=7eb3d87742b1f7239f0f6e9c8b7b9250ac216f4a;p=lhc%2Fweb%2Fwiklou.git Rename UncategorizedCategoriesPageTest to match class name Change-Id: Iedf32a15e0a8cb79a2823ccffa3b486a38fb1dc6 --- diff --git a/tests/phpunit/includes/specials/SpecialUncategorizedcategoriesTest.php b/tests/phpunit/includes/specials/SpecialUncategorizedcategoriesTest.php deleted file mode 100644 index 80bd365f35..0000000000 --- a/tests/phpunit/includes/specials/SpecialUncategorizedcategoriesTest.php +++ /dev/null @@ -1,63 +0,0 @@ -getMockBuilder( RequestContext::class )->getMock(); - $mockContext->method( 'msg' )->willReturn( $msg ); - $special = new UncategorizedCategoriesPage(); - $special->setContext( $mockContext ); - $this->assertEquals( [ - 'tables' => [ - 0 => 'page', - 1 => 'categorylinks', - ], - 'fields' => [ - 'namespace' => 'page_namespace', - 'title' => 'page_title', - 'value' => 'page_title', - ], - 'conds' => [ - 0 => 'cl_from IS NULL', - 'page_namespace' => 14, - 'page_is_redirect' => 0, - ] + $expected, - 'join_conds' => [ - 'categorylinks' => [ - 0 => 'LEFT JOIN', - 1 => 'cl_from = page_id', - ], - ], - ], $special->getQueryInfo() ); - } - - public function provideTestGetQueryInfoData() { - return [ - [ - "* Stubs\n* Test\n* *\n* * test123", - [ 1 => "page_title not in ( 'Stubs','Test','*','*_test123' )" ] - ], - [ - "Stubs\n* Test\n* *\n* * test123", - [ 1 => "page_title not in ( 'Test','*','*_test123' )" ] - ], - [ - "* StubsTest\n* *\n* * test123", - [ 1 => "page_title not in ( 'StubsTest','*','*_test123' )" ] - ], - [ "", [] ], - [ "\n\n\n", [] ], - [ "\n", [] ], - [ "Test\n*Test2", [ 1 => "page_title not in ( 'Test2' )" ] ], - [ "Test", [] ], - [ "*Test\nTest2", [ 1 => "page_title not in ( 'Test' )" ] ], - [ "Test\nTest2", [] ], - ]; - } -} diff --git a/tests/phpunit/includes/specials/UncategorizedCategoriesPageTest.php b/tests/phpunit/includes/specials/UncategorizedCategoriesPageTest.php new file mode 100644 index 0000000000..80bd365f35 --- /dev/null +++ b/tests/phpunit/includes/specials/UncategorizedCategoriesPageTest.php @@ -0,0 +1,63 @@ +getMockBuilder( RequestContext::class )->getMock(); + $mockContext->method( 'msg' )->willReturn( $msg ); + $special = new UncategorizedCategoriesPage(); + $special->setContext( $mockContext ); + $this->assertEquals( [ + 'tables' => [ + 0 => 'page', + 1 => 'categorylinks', + ], + 'fields' => [ + 'namespace' => 'page_namespace', + 'title' => 'page_title', + 'value' => 'page_title', + ], + 'conds' => [ + 0 => 'cl_from IS NULL', + 'page_namespace' => 14, + 'page_is_redirect' => 0, + ] + $expected, + 'join_conds' => [ + 'categorylinks' => [ + 0 => 'LEFT JOIN', + 1 => 'cl_from = page_id', + ], + ], + ], $special->getQueryInfo() ); + } + + public function provideTestGetQueryInfoData() { + return [ + [ + "* Stubs\n* Test\n* *\n* * test123", + [ 1 => "page_title not in ( 'Stubs','Test','*','*_test123' )" ] + ], + [ + "Stubs\n* Test\n* *\n* * test123", + [ 1 => "page_title not in ( 'Test','*','*_test123' )" ] + ], + [ + "* StubsTest\n* *\n* * test123", + [ 1 => "page_title not in ( 'StubsTest','*','*_test123' )" ] + ], + [ "", [] ], + [ "\n\n\n", [] ], + [ "\n", [] ], + [ "Test\n*Test2", [ 1 => "page_title not in ( 'Test2' )" ] ], + [ "Test", [] ], + [ "*Test\nTest2", [ 1 => "page_title not in ( 'Test' )" ] ], + [ "Test\nTest2", [] ], + ]; + } +}