diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php index 3501aec44a8..ca387a243dc 100644 --- a/tests/phpunit/includes/content/TextContentTest.php +++ b/tests/phpunit/includes/content/TextContentTest.php @@ -349,12 +349,15 @@ class TextContentTest extends MediaWikiLangTestCase { * @dataProvider dataGetDeletionUpdates */ public function testDeletionUpdates( $title, $model, $text, $expectedStuff ) { - $title = Title::newFromText( $title ); - $title->resetArticleID( 2342 ); //dummy id. fine as long as we don't try to execute the updates! + $ns = $this->getDefaultWikitextNS(); + $title = Title::newFromText( $title, $ns ); $content = ContentHandler::makeContent( $text, $title, $model ); - $updates = $content->getDeletionUpdates( WikiPage::factory( $title ) ); + $page = WikiPage::factory( $title ); + $page->doEditContent( $content, '' ); + + $updates = $content->getDeletionUpdates( $page ); // make updates accessible by class name foreach ( $updates as $update ) { @@ -377,6 +380,8 @@ class TextContentTest extends MediaWikiLangTestCase { $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" ); } } + + $page->doDeleteArticle( '' ); } public static function provideConvert() { diff --git a/tests/phpunit/includes/content/WikitextContentTest.php b/tests/phpunit/includes/content/WikitextContentTest.php index b76e9aae30c..7cf473ea787 100644 --- a/tests/phpunit/includes/content/WikitextContentTest.php +++ b/tests/phpunit/includes/content/WikitextContentTest.php @@ -69,11 +69,14 @@ more stuff * @group Database */ public function testGetSecondaryDataUpdates( $title, $model, $text, $expectedStuff ) { - $title = Title::newFromText( $title ); - $title->resetArticleID( 2342 ); //dummy id. fine as long as we don't try to execute the updates! + $ns = $this->getDefaultWikitextNS(); + $title = Title::newFromText( $title, $ns ); $content = ContentHandler::makeContent( $text, $title, $model ); + $page = WikiPage::factory( $title ); + $page->doEditContent( $content, '' ); + $updates = $content->getSecondaryDataUpdates( $title ); // make updates accessible by class name @@ -92,6 +95,8 @@ more stuff $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" ); } } + + $page->doDeleteArticle( '' ); } public static function dataGetSection() {