$content = $page->getContent();
$this->assertNotNull( $content, 'Page should have been created' );
- $text = $content->getNativeData();
+ $text = $content->getText();
$this->assertSame( $expected, $text );
}
$this->assertSame( 'Success', $re['edit']['result'] );
$newtext = WikiPage::factory( Title::newFromText( $name ) )
->getContent( Revision::RAW )
- ->getNativeData();
+ ->getText();
$this->assertSame( "==section 1==\nnew content 1\n\n==section 2==\ncontent2", $newtext );
// Test that we raise a 'nosuchsection' error
// Check the page text is correct
$text = WikiPage::factory( Title::newFromText( $name ) )
->getContent( Revision::RAW )
- ->getNativeData();
+ ->getText();
$this->assertSame( "== header ==\n\ntest", $text );
// Now on one that does
$this->assertSame( 'Success', $re2['edit']['result'] );
$text = WikiPage::factory( Title::newFromText( $name ) )
->getContent( Revision::RAW )
- ->getNativeData();
+ ->getText();
$this->assertSame( "== header ==\n\ntest\n\n== header ==\n\ntest", $text );
}
'undoafter' => $revId1,
] );
- $text = ( new WikiPage( $titleObj ) )->getContent()->getNativeData();
+ $text = ( new WikiPage( $titleObj ) )->getContent()->getText();
// This is wrong! It should be 1. But let's test for our incorrect
// behavior for now, so if someone fixes it they'll fix the test as
] );
$text = ( new WikiPage( Title::newFromText( $name ) ) )->getContent()
- ->getNativeData();
+ ->getText();
$this->assertSame( '3', $text );
}
] );
$text = ( new WikiPage( Title::newFromText( $name ) ) )->getContent()
- ->getNativeData();
+ ->getText();
$this->assertSame( '1', $text );
}
] );
$text = ( new WikiPage( Title::newFromText( $name ) ) )
- ->getContent()->getNativeData();
+ ->getContent()->getText();
$this->assertSame( 'Alert: Some text', $text );
}
] );
$text = ( new WikiPage( Title::newFromText( $name ) ) )
- ->getContent()->getNativeData();
+ ->getContent()->getText();
$this->assertSame( 'Some text is nice', $text );
}
] );
$text = ( new WikiPage( Title::newFromText( $name ) ) )
- ->getContent()->getNativeData();
+ ->getContent()->getText();
$this->assertSame( 'Alert: Some text is nice', $text );
}
} finally {
// Validate that content was not changed
$text = ( new WikiPage( Title::newFromText( $name ) ) )
- ->getContent()->getNativeData();
+ ->getContent()->getText();
$this->assertSame( 'Some text', $text );
}
] );
$text = ( new WikiPage( Title::newFromText( $name ) ) )
- ->getContent()->getNativeData();
+ ->getContent()->getText();
$this->assertSame( "Initial content\n\n== New section ==", $text );
}
$page = new WikiPage( Title::newFromText( $name ) );
$this->assertSame( "Initial content\n\n== My section ==\n\nMore content",
- $page->getContent()->getNativeData() );
+ $page->getContent()->getText() );
$this->assertSame( '/* My section */ new section',
$page->getRevision()->getComment() );
}
$page = new WikiPage( Title::newFromText( $name ) );
$this->assertSame( "Initial content\n\n== Add new section ==\n\nMore content",
- $page->getContent()->getNativeData() );
+ $page->getContent()->getText() );
// EditPage actually assumes the summary is the section name here
$this->assertSame( '/* Add new section */ new section',
$page->getRevision()->getComment() );
$page = new WikiPage( Title::newFromText( $name ) );
$this->assertSame( "Initial content\n\n== My section ==\n\nMore content",
- $page->getContent()->getNativeData() );
+ $page->getContent()->getText() );
$this->assertSame( 'Add new section',
$page->getRevision()->getComment() );
}
] );
$text = ( new WikiPage( Title::newFromText( $name ) ) )
- ->getContent()->getNativeData();
+ ->getContent()->getText();
$this->assertSame( "== Section 1 ==\n\nContent and more content\n\n" .
"== Section 2 ==\n\nFascinating!", $text );
] );
$text = ( new WikiPage( Title::newFromText( $name ) ) )
- ->getContent()->getNativeData();
+ ->getContent()->getText();
$this->assertSame( "Content and more content\n\n== Section 1 ==\n\n" .
"Fascinating!", $text );
] );
} finally {
$text = ( new WikiPage( Title::newFromText( $name ) ) )
- ->getContent()->getNativeData();
+ ->getContent()->getText();
$this->assertSame( 'Content', $text );
}
] );
} finally {
$text = ( new WikiPage( Title::newFromText( $name ) ) )
- ->getContent()->getNativeData();
+ ->getContent()->getText();
$this->assertSame( 'Content', $text );
}
'ctd_name',
[ 'ct_rev_id' => $revId ],
__METHOD__,
- [ 'change_tag_def' => [ 'INNER JOIN', 'ctd_id = ct_tag_id' ] ]
+ [ 'change_tag_def' => [ 'JOIN', 'ctd_id = ct_tag_id' ] ]
)
);
}
public function testEditWhileBlocked() {
$name = 'Help:' . ucfirst( __FUNCTION__ );
- $this->setExpectedException( ApiUsageException::class,
- 'You have been blocked from editing.' );
+ $this->assertNull( Block::newFromTarget( '127.0.0.1' ), 'Sanity check' );
$block = new Block( [
'address' => self::$users['sysop']->getUser()->getName(),
'reason' => 'Capriciousness',
'timestamp' => '19370101000000',
'expiry' => 'infinity',
+ 'enableAutoblock' => true,
] );
$block->insert();
'title' => $name,
'text' => 'Some text',
] );
+ $this->fail( 'Expected exception not thrown' );
+ } catch ( ApiUsageException $ex ) {
+ $this->assertSame( 'You have been blocked from editing.', $ex->getMessage() );
+ $this->assertNotNull( Block::newFromTarget( '127.0.0.1' ), 'Autoblock spread' );
} finally {
$block->delete();
self::$users['sysop']->getUser()->clearInstanceCache();