X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Ftitle%2FForeignTitleTest.php;h=b6c242780778d3257d8264e7c504d45dddde63c9;hb=94749fa62e95407fc82d9875caf5434a97d4620f;hp=599d2a33a4d026fd21e26a896b4109115a3ab761;hpb=32ed8f891b04f0851b23ac48b0acf28100a45b6c;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/title/ForeignTitleTest.php b/tests/phpunit/includes/title/ForeignTitleTest.php index 599d2a33a4..b6c2427807 100644 --- a/tests/phpunit/includes/title/ForeignTitleTest.php +++ b/tests/phpunit/includes/title/ForeignTitleTest.php @@ -27,24 +27,24 @@ class ForeignTitleTest extends MediaWikiTestCase { public function basicProvider() { - return array( - array( + return [ + [ new ForeignTitle( 20, 'Contributor', 'JohnDoe' ), 20, 'Contributor', 'JohnDoe' - ), - array( + ], + [ new ForeignTitle( '1', 'Discussion', 'Capital' ), 1, 'Discussion', 'Capital' - ), - array( + ], + [ new ForeignTitle( 0, '', 'MainNamespace' ), 0, '', 'MainNamespace' - ), - array( + ], + [ new ForeignTitle( 4, 'Some ns', 'Article title with spaces' ), 4, 'Some_ns', 'Article_title_with_spaces' - ), - ); + ], + ]; } /** @@ -59,7 +59,7 @@ class ForeignTitleTest extends MediaWikiTestCase { $this->assertEquals( $expectedText, $title->getText() ); } - public function testUnknownNamespaceCheck( ) { + public function testUnknownNamespaceCheck() { $title = new ForeignTitle( null, 'this', 'that' ); $this->assertEquals( false, $title->isNamespaceIdKnown() ); @@ -67,31 +67,31 @@ class ForeignTitleTest extends MediaWikiTestCase { $this->assertEquals( 'that', $title->getText() ); } - public function testUnknownNamespaceError( ) { + public function testUnknownNamespaceError() { $this->setExpectedException( 'MWException' ); $title = new ForeignTitle( null, 'this', 'that' ); $title->getNamespaceId(); } public function fullTextProvider() { - return array( - array( + return [ + [ new ForeignTitle( 20, 'Contributor', 'JohnDoe' ), 'Contributor:JohnDoe' - ), - array( + ], + [ new ForeignTitle( '1', 'Discussion', 'Capital' ), 'Discussion:Capital' - ), - array( + ], + [ new ForeignTitle( 0, '', 'MainNamespace' ), 'MainNamespace' - ), - array( + ], + [ new ForeignTitle( 4, 'Some ns', 'Article title with spaces' ), 'Some_ns:Article_title_with_spaces' - ), - ); + ], + ]; } /**