From 9f3832efdf5da1c099c5b5e1122fab1360fda42f Mon Sep 17 00:00:00 2001 From: DannyS712 Date: Fri, 8 May 2020 00:16:42 +0000 Subject: [PATCH] Revert "Remove use of WikiPage::doEditContent" This reverts commit eb94a40c3ec8b3da8c8e32ac15bfcce09c795303. Reason for revert: autopatrol status wasn't included in the use of PageUpdater, revert for now and reapply properly with autopatrol later. Bug: T252179 Change-Id: I38e29e607bc01146ccab00ef8e10d59b769e4044 --- tests/phpunit/TemplateStylesHooksTest.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/tests/phpunit/TemplateStylesHooksTest.php b/tests/phpunit/TemplateStylesHooksTest.php index ba6cb81..3ecb872 100644 --- a/tests/phpunit/TemplateStylesHooksTest.php +++ b/tests/phpunit/TemplateStylesHooksTest.php @@ -1,7 +1,6 @@ getUser(); - $summary = CommentStoreComment::newUnsavedComment( 'Test for TemplateStyles' ); - - $updater = $wikipage->newPageUpdater( $user ); - $updater->setContent( - SlotRecord::MAIN, - $content - ); - $updater->saveRevision( $summary ); - - if ( !$updater->wasSuccessful() ) { - $this->fail( "Failed to create $title." ); + $status = $page->doEditContent( $content, 'Test for TemplateStyles', 0, false, $user ); + if ( !$status->isOk() ) { + $this->fail( "Failed to create $title: " . $status->getWikiText( false, false, 'en' ) ); } }