* ^--- important, causes tests not to fail with timeout
*/
class RevisionStorageTest extends MediaWikiTestCase {
-
/**
* @var WikiPage $the_page
*/
- var $the_page;
+ private $the_page;
function __construct( $name = null, array $data = array(), $dataName = '' ) {
parent::__construct( $name, $data, $dataName );
MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache
$wgContLang->resetNamespaces(); # reset namespace cache
if ( !$this->the_page ) {
- $this->the_page = $this->createPage( 'RevisionStorageTest_the_page', "just a dummy page", CONTENT_MODEL_WIKITEXT );
+ $this->the_page = $this->createPage(
+ 'RevisionStorageTest_the_page',
+ "just a dummy page",
+ CONTENT_MODEL_WIKITEXT
+ );
}
}
* @covers Revision::newFromArchiveRow
*/
public function testNewFromArchiveRow() {
- $page = $this->createPage( 'RevisionStorageTest_testNewFromArchiveRow', 'Lorem Ipsum', CONTENT_MODEL_WIKITEXT );
+ $page = $this->createPage(
+ 'RevisionStorageTest_testNewFromArchiveRow',
+ 'Lorem Ipsum',
+ CONTENT_MODEL_WIKITEXT
+ );
$orig = $page->getRevision();
$page->doDeleteArticle( 'test Revision::newFromArchiveRow' );
* @covers Revision::fetchRevision
*/
public function testFetchRevision() {
- $page = $this->createPage( 'RevisionStorageTest_testFetchRevision', 'one', CONTENT_MODEL_WIKITEXT );
+ $page = $this->createPage(
+ 'RevisionStorageTest_testFetchRevision',
+ 'one',
+ CONTENT_MODEL_WIKITEXT
+ );
// Hidden process cache assertion below
$page->getRevision()->getId();
$this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields' );
$this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields' );
- $this->assertTrue( in_array( 'rev_timestamp', $fields ), 'missing rev_timestamp in list of fields' );
+ $this->assertTrue(
+ in_array( 'rev_timestamp', $fields ),
+ 'missing rev_timestamp in list of fields'
+ );
$this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields' );
if ( $wgContentHandlerUseDB ) {
* @covers Revision::isCurrent
*/
public function testIsCurrent() {
- $page = $this->createPage( 'RevisionStorageTest_testIsCurrent', 'Lorem Ipsum', CONTENT_MODEL_WIKITEXT );
+ $page = $this->createPage(
+ 'RevisionStorageTest_testIsCurrent',
+ 'Lorem Ipsum',
+ CONTENT_MODEL_WIKITEXT
+ );
$rev1 = $page->getRevision();
# @todo find out if this should be true
$rev1x = Revision::newFromId( $rev1->getId() );
$this->assertTrue( $rev1x->isCurrent() );
- $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ), 'second rev' );
+ $page->doEditContent(
+ ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
+ 'second rev'
+ );
$rev2 = $page->getRevision();
# @todo find out if this should be true
* @covers Revision::getPrevious
*/
public function testGetPrevious() {
- $page = $this->createPage( 'RevisionStorageTest_testGetPrevious', 'Lorem Ipsum testGetPrevious', CONTENT_MODEL_WIKITEXT );
+ $page = $this->createPage(
+ 'RevisionStorageTest_testGetPrevious',
+ 'Lorem Ipsum testGetPrevious',
+ CONTENT_MODEL_WIKITEXT
+ );
$rev1 = $page->getRevision();
$this->assertNull( $rev1->getPrevious() );
- $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
+ $page->doEditContent(
+ ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
'second rev testGetPrevious' );
$rev2 = $page->getRevision();
* @covers Revision::getNext
*/
public function testGetNext() {
- $page = $this->createPage( 'RevisionStorageTest_testGetNext', 'Lorem Ipsum testGetNext', CONTENT_MODEL_WIKITEXT );
+ $page = $this->createPage(
+ 'RevisionStorageTest_testGetNext',
+ 'Lorem Ipsum testGetNext',
+ CONTENT_MODEL_WIKITEXT
+ );
$rev1 = $page->getRevision();
$this->assertNull( $rev1->getNext() );
- $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
- 'second rev testGetNext' );
+ $page->doEditContent(
+ ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
+ 'second rev testGetNext'
+ );
$rev2 = $page->getRevision();
$this->assertNotNull( $rev1->getNext() );
* @covers Revision::newNullRevision
*/
public function testNewNullRevision() {
- $page = $this->createPage( 'RevisionStorageTest_testNewNullRevision', 'some testing text', CONTENT_MODEL_WIKITEXT );
+ $page = $this->createPage(
+ 'RevisionStorageTest_testNewNullRevision',
+ 'some testing text',
+ CONTENT_MODEL_WIKITEXT
+ );
$orig = $page->getRevision();
$dbw = wfGetDB( DB_MASTER );
# zero
$revisions[0] = new Revision( array(
'page' => $page->getId(),
- 'title' => $page->getTitle(), // we need the title to determine the page's default content model
+ // we need the title to determine the page's default content model
+ 'title' => $page->getTitle(),
'timestamp' => '20120101000000',
'user' => $userA->getId(),
'text' => 'zero',
# one
$revisions[1] = new Revision( array(
'page' => $page->getId(),
- 'title' => $page->getTitle(), // still need the title, because $page->getId() is 0 (there's no entry in the page table)
+ // still need the title, because $page->getId() is 0 (there's no entry in the page table)
+ 'title' => $page->getTitle(),
'timestamp' => '20120101000100',
'user' => $userA->getId(),
'text' => 'one',