X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FSampleTest.php;h=3d74ae3efcb7431f1c83193d92ab2317745ca965;hb=767042c3e68adb29513;hp=c5944d16f4237e17814711df6d949b7c5e1d8efa;hpb=4f21e6be661f7305abc223bb31600970a3fb5326;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/SampleTest.php b/tests/phpunit/includes/SampleTest.php index c5944d16f4..3d74ae3efc 100644 --- a/tests/phpunit/includes/SampleTest.php +++ b/tests/phpunit/includes/SampleTest.php @@ -1,6 +1,6 @@ setMwGlobals( array( + $this->setMwGlobals( [ 'wgContLang' => Language::factory( 'en' ), 'wgLanguageCode' => 'en', 'wgCapitalLinks' => true, - ) ); + ] ); } /** @@ -32,11 +32,11 @@ class TestSample extends MediaWikiLangTestCase { * they run. While MediaWiki isn't strictly an Agile Programming * project, you are encouraged to use the naming described under * "Agile Documentation" at - * http://www.phpunit.de/manual/3.4/en/other-uses-for-tests.html + * https://www.phpunit.de/manual/3.4/en/other-uses-for-tests.html */ public function testTitleObjectStringConversion() { $title = Title::newFromText( "text" ); - $this->assertInstanceOf( 'Title', $title, "Title creation" ); + $this->assertInstanceOf( Title::class, $title, "Title creation" ); $this->assertEquals( "Text", $title, "Automatic string conversion" ); $title = Title::newFromText( "text", NS_MEDIA ); @@ -45,23 +45,23 @@ class TestSample extends MediaWikiLangTestCase { /** * If you want to run a the same test with a variety of data, use a data provider. - * see: http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html + * see: https://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html */ public static function provideTitles() { - return array( - array( 'Text', NS_MEDIA, 'Media:Text' ), - array( 'Text', null, 'Text' ), - array( 'text', null, 'Text' ), - array( 'Text', NS_USER, 'User:Text' ), - array( 'Photo.jpg', NS_FILE, 'File:Photo.jpg' ) - ); + return [ + [ 'Text', NS_MEDIA, 'Media:Text' ], + [ 'Text', null, 'Text' ], + [ 'text', null, 'Text' ], + [ 'Text', NS_USER, 'User:Text' ], + [ 'Photo.jpg', NS_FILE, 'File:Photo.jpg' ] + ]; } /** + * phpcs:disable Generic.Files.LineLength * @dataProvider provideTitles - * @codingStandardsIgnoreStart Ignore long line warning - * See http://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.dataProvider - * @codingStandardsIgnoreEnd + * See https://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.dataProvider + * phpcs:enable */ public function testCreateBasicListOfTitles( $titleName, $ns, $text ) { $title = Title::newFromText( $titleName, $ns ); @@ -89,18 +89,16 @@ class TestSample extends MediaWikiLangTestCase { /** * @depends testSetUpMainPageTitleForNextTest - * See http://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.depends + * See https://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.depends */ public function testCheckMainPageTitleIsConsideredLocal( $title ) { $this->assertTrue( $title->isLocal() ); } - // @codingStandardsIgnoreStart Ignore long line warning /** * @expectedException InvalidArgumentException - * See http://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.expectedException + * See https://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.expectedException */ - // @codingStandardsIgnoreEnd public function testTitleObjectFromObject() { $title = Title::newFromText( Title::newFromText( "test" ) ); $this->assertEquals( "Test", $title->isLocal() );