X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fpage%2FWikiPageDbTestBase.php;h=cc20b6bd30018d82c292577290580f36e7673e4e;hb=6bfa7c37540da7605e88c10caf0295ae8ff45723;hp=40c4e1ecd32bb0a3d3e23f24bda7e09b0dc468c0;hpb=20670b2ef91c3afbfacdd0a881648a27be0d282d;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/page/WikiPageDbTestBase.php b/tests/phpunit/includes/page/WikiPageDbTestBase.php index 40c4e1ecd3..cc20b6bd30 100644 --- a/tests/phpunit/includes/page/WikiPageDbTestBase.php +++ b/tests/phpunit/includes/page/WikiPageDbTestBase.php @@ -30,10 +30,29 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase { 'iwlinks' ] ); } + /** + * @return int + */ + abstract protected function getMcrMigrationStage(); + + /** + * @return string[] + */ + abstract protected function getMcrTablesToReset(); + protected function setUp() { parent::setUp(); + + $this->tablesUsed += $this->getMcrTablesToReset(); + $this->setMwGlobals( 'wgContentHandlerUseDB', $this->getContentHandlerUseDB() ); + $this->setMwGlobals( + 'wgMultiContentRevisionSchemaMigrationStage', + $this->getMcrMigrationStage() + ); $this->pagesToDelete = []; + + $this->overrideMwServices(); } protected function tearDown() { @@ -96,6 +115,8 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase { * @covers WikiPage::doEditUpdates */ public function testDoEditContent() { + $this->setMwGlobals( 'wgPageCreationLog', true ); + $page = $this->newPage( __METHOD__ ); $title = $page->getTitle(); @@ -108,13 +129,21 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase { $page->doEditContent( $content, "[[testing]] 1" ); + $id = $page->getId(); + + // Test page creation logging + $this->assertSelect( + 'logging', + [ 'log_type', 'log_action' ], + [ 'log_page' => $id ], + [ [ 'create', 'create' ] ] + ); + $this->assertTrue( $title->getArticleID() > 0, "Title object should have new page id" ); - $this->assertTrue( $page->getId() > 0, "WikiPage should have new page id" ); + $this->assertTrue( $id > 0, "WikiPage should have new page id" ); $this->assertTrue( $title->exists(), "Title object should indicate that the page now exists" ); $this->assertTrue( $page->exists(), "WikiPage object should indicate that the page now exists" ); - $id = $page->getId(); - # ------------------------ $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );