diff options
author | daniel <daniel.kinzler@wikimedia.de> | 2018-07-04 15:39:24 +0200 |
---|---|---|
committer | daniel <daniel.kinzler@wikimedia.de> | 2018-09-11 12:27:42 +0200 |
commit | 9bd162dce2c8deae722ffed4111f69e24ae07f03 (patch) | |
tree | de5353ba187e58cc95ffb3e0d7bd9d6a5c4bd207 /tests/phpunit/includes/content/TextContentTest.php | |
parent | 452c71663bd143b74af1af7c88d423b4178cfff5 (diff) | |
download | mediawikicore-9bd162dce2c8deae722ffed4111f69e24ae07f03.tar.gz mediawikicore-9bd162dce2c8deae722ffed4111f69e24ae07f03.zip |
[MCR] Set MCR migration stage to write-both/read-new.
This patch exists to see if CI passes with
$wgMultiContentRevisionSchemaMigrationStage set to
SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW.
NOTE: verify that $wgMultiContentRevisionSchemaMigrationStage
is explicitly set toSCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
in production config (T197816) before merging this.
Bug: T198561
Depends-On: Ib718868d2c768b6ea851355eef047bc0e6593495
Change-Id: I15989adae2b5916577d164c50d7da88774e49324
Diffstat (limited to 'tests/phpunit/includes/content/TextContentTest.php')
-rw-r--r-- | tests/phpunit/includes/content/TextContentTest.php | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php index b01a7db04a0a..d69cfd1a86b0 100644 --- a/tests/phpunit/includes/content/TextContentTest.php +++ b/tests/phpunit/includes/content/TextContentTest.php @@ -13,6 +13,10 @@ class TextContentTest extends MediaWikiLangTestCase { protected function setUp() { parent::setUp(); + // trigger purging of all page related tables + $this->tablesUsed[] = 'page'; + $this->tablesUsed[] = 'revision'; + // Anon user $user = new User(); $user->setName( '127.0.0.1' ); @@ -352,11 +356,11 @@ class TextContentTest extends MediaWikiLangTestCase { public static function dataGetDeletionUpdates() { return [ - [ "TextContentTest_testGetSecondaryDataUpdates_1", + [ CONTENT_MODEL_TEXT, "hello ''world''\n", [] ], - [ "TextContentTest_testGetSecondaryDataUpdates_2", + [ CONTENT_MODEL_TEXT, "hello [[world test 21344]]\n", [] ], @@ -368,13 +372,11 @@ class TextContentTest extends MediaWikiLangTestCase { * @dataProvider dataGetDeletionUpdates * @covers TextContent::getDeletionUpdates */ - public function testDeletionUpdates( $title, $model, $text, $expectedStuff ) { - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( $title, $ns ); + public function testDeletionUpdates( $model, $text, $expectedStuff ) { + $page = $this->getNonexistingTestPage( get_class( $this ) . '-' . $this->getName() ); + $title = $page->getTitle(); $content = ContentHandler::makeContent( $text, $title, $model ); - - $page = WikiPage::factory( $title ); $page->doEditContent( $content, '' ); $updates = $content->getDeletionUpdates( $page ); @@ -385,11 +387,6 @@ class TextContentTest extends MediaWikiLangTestCase { $updates[$class] = $update; } - if ( !$expectedStuff ) { - $this->assertTrue( true ); // make phpunit happy - return; - } - foreach ( $expectedStuff as $class => $fieldValues ) { $this->assertArrayHasKey( $class, $updates, "missing an update of type $class" ); @@ -401,7 +398,8 @@ class TextContentTest extends MediaWikiLangTestCase { } } - $page->doDeleteArticle( '' ); + // make phpunit happy even if $expectedStuff was empty + $this->assertTrue( true ); } public static function provideConvert() { |