Merge "filebackend: Convert trigger_error to PSR log warning"
[lhc/web/wiklou.git] / tests / phpunit / includes / content / WikitextContentTest.php
index f689cae..fc1c42d 100644 (file)
@@ -182,9 +182,10 @@ just a test"
         */
        public function testReplaceSection( $text, $section, $with, $sectionTitle, $expected ) {
                $content = $this->newContent( $text );
+               /** @var WikitextContent $c */
                $c = $content->replaceSection( $section, $this->newContent( $with ), $sectionTitle );
 
-               $this->assertEquals( $expected, is_null( $c ) ? null : $c->getText() );
+               $this->assertEquals( $expected, $c ? $c->getText() : null );
        }
 
        /**
@@ -360,6 +361,10 @@ just a test"
                $this->assertEquals( CONTENT_MODEL_WIKITEXT, $content->getContentHandler()->getModelID() );
        }
 
+       /**
+        * @covers ParserOptions::getRedirectTarget
+        * @covers ParserOptions::setRedirectTarget
+        */
        public function testRedirectParserOption() {
                $title = Title::newFromText( 'testRedirectParserOption' );
 
@@ -385,7 +390,7 @@ just a test"
                $this->assertEquals( 'hello world.', $wikitext,
                        'Wikitext passed to hook was not as expected'
                );
-               $this->assertEquals( null, $redirectTarget, 'Redirect seen in hook was not null' );
+               $this->assertNull( $redirectTarget, 'Redirect seen in hook was not null' );
                $this->assertEquals( $title, $options->getRedirectTarget(),
                        'ParserOptions\' redirectTarget was changed'
                );
@@ -412,8 +417,7 @@ just a test"
                        $redirectTarget->getFullText(),
                        'Redirect seen in hook was not the expected title'
                );
-               $this->assertEquals(
-                       null,
+               $this->assertNull(
                        $options->getRedirectTarget(),
                        'ParserOptions\' redirectTarget was changed'
                );