Pass phpcs-strict on some test files (3/x)
[lhc/web/wiklou.git] / tests / phpunit / includes / SampleTest.php
index 1439e44..758c2e2 100644 (file)
@@ -33,22 +33,20 @@ class TestSample extends MediaWikiLangTestCase {
         * "Agile Documentation" at
         * http://www.phpunit.de/manual/3.4/en/other-uses-for-tests.html
         */
-       function testTitleObjectStringConversion() {
-               $title = Title::newFromText("text");
-               $this->assertInstanceOf('Title', $title, "Title creation");
-               $this->assertEquals("Text", $title, "Automatic string conversion");
+       public function testTitleObjectStringConversion() {
+               $title = Title::newFromText( "text" );
+               $this->assertInstanceOf( 'Title', $title, "Title creation" );
+               $this->assertEquals( "Text", $title, "Automatic string conversion" );
 
-               $title = Title::newFromText("text", NS_MEDIA);
-               $this->assertEquals("Media:Text", $title, "Title creation with namespace");
+               $title = Title::newFromText( "text", NS_MEDIA );
+               $this->assertEquals( "Media:Text", $title, "Title creation with namespace" );
        }
 
        /**
-        * If you want to run a the same test with a variety of data. use a data provider.
+        * 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
-        *
-        * Note: Data providers are always called statically and outside setUp/tearDown!
         */
-       public static function provideTitles() {
+       public function provideTitles() {
                return array(
                        array( 'Text', NS_MEDIA, 'Media:Text' ),
                        array( 'Text', null, 'Text' ),
@@ -58,18 +56,20 @@ class TestSample extends MediaWikiLangTestCase {
                );
        }
 
+       // @codingStandardsIgnoreStart Ignore long line warning
        /**
         * @dataProvider provideTitles
-        * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider
+        * See http://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.dataProvider
         */
-       public function testCreateBasicListOfTitles($titleName, $ns, $text) {
-               $title = Title::newFromText($titleName, $ns);
-               $this->assertEquals($text, "$title", "see if '$titleName' matches '$text'");
+       // @codingStandardsIgnoreEnd
+       public function testCreateBasicListOfTitles( $titleName, $ns, $text ) {
+               $title = Title::newFromText( $titleName, $ns );
+               $this->assertEquals( $text, "$title", "see if '$titleName' matches '$text'" );
        }
 
        public function testSetUpMainPageTitleForNextTest() {
                $title = Title::newMainPage();
-               $this->assertEquals("Main Page", "$title", "Test initial creation of a title");
+               $this->assertEquals( "Main Page", "$title", "Test initial creation of a title" );
 
                return $title;
        }
@@ -88,17 +88,19 @@ class TestSample extends MediaWikiLangTestCase {
 
        /**
         * @depends testSetUpMainPageTitleForNextTest
-        * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.depends
+        * See http://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 MWException object
-        * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException
+        * See http://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.expectedException
         */
-       function testTitleObjectFromObject() {
+       // @codingStandardsIgnoreEnd
+       public function testTitleObjectFromObject() {
                $title = Title::newFromText( Title::newFromText( "test" ) );
                $this->assertEquals( "Test", $title->isLocal() );
        }