*/
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 );
}
/**
$this->assertEquals( CONTENT_MODEL_WIKITEXT, $content->getContentHandler()->getModelID() );
}
+ /**
+ * @covers ParserOptions::getRedirectTarget
+ * @covers ParserOptions::setRedirectTarget
+ */
public function testRedirectParserOption() {
$title = Title::newFromText( 'testRedirectParserOption' );
$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'
);
$redirectTarget->getFullText(),
'Redirect seen in hook was not the expected title'
);
- $this->assertEquals(
- null,
+ $this->assertNull(
$options->getRedirectTarget(),
'ParserOptions\' redirectTarget was changed'
);