protected function tearDown() {
foreach ( $this->pagesToDelete as $p ) {
- /* @var $p WikiPage */
+ /* @var WikiPage $p */
try {
if ( $p->exists() ) {
'delete',
'delete',
'testing user 0 deletion',
- '0',
+ null,
'127.0.0.1',
(string)$page->getTitle()->getNamespace(),
$page->getTitle()->getDBkey(),
# now, test the actual redirect
$t = $page->getRedirectTarget();
- $this->assertEquals( $target, is_null( $t ) ? null : $t->getFullText() );
+ $this->assertEquals( $target, $t ? $t->getFullText() : null );
}
/**
$page = $this->createPage( $title, $text, $model );
$content = ContentHandler::makeContent( $with, $page->getTitle(), $page->getContentModel() );
+ /** @var TextContent $c */
$c = $page->replaceSectionContent( $section, $content, $sectionTitle );
- $this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getText() ) );
+ $this->assertEquals( $expected, $c ? trim( $c->getText() ) : null );
}
/**
$baseRevId = $page->getLatest();
$content = ContentHandler::makeContent( $with, $page->getTitle(), $page->getContentModel() );
+ /** @var TextContent $c */
$c = $page->replaceSectionAtRev( $section, $content, $sectionTitle, $baseRevId );
- $this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getText() ) );
+ $this->assertEquals( $expected, $c ? trim( $c->getText() ) : null );
}
/**