From 80fe5f9228ef6f1285989327abddeab727ca57d3 Mon Sep 17 00:00:00 2001 From: DannyS712 Date: Wed, 25 Mar 2020 06:43:05 +0000 Subject: [PATCH] Use new signature for WikiPage::doDeleteArticleReal in MW 1.35+ Bug: T247869 Change-Id: I606611d2cf5cd77c8cef68cc96def9207d2e5940 --- tests/phpunit/ApiCoreThankIntegrationTest.php | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/ApiCoreThankIntegrationTest.php b/tests/phpunit/ApiCoreThankIntegrationTest.php index 46a0b14d..05cdc329 100644 --- a/tests/phpunit/ApiCoreThankIntegrationTest.php +++ b/tests/phpunit/ApiCoreThankIntegrationTest.php @@ -41,8 +41,12 @@ class ApiCoreThankIntegrationTest extends ApiTestCase { // If the page already exists, delete it, otherwise our edit will not result in a new revision if ( $pageTitle->exists() ) { $wikiPage = WikiPage::factory( $pageTitle ); - $error = ''; // passed by reference - $wikiPage->doDeleteArticleReal( '', false, null, null, $error, $user ); + if ( version_compare( MW_VERSION, '1.35', '<' ) ) { + $error = ''; // passed by reference + $wikiPage->doDeleteArticleReal( '', false, null, null, $error, $user ); + } else { + $wikiPage->doDeleteArticleReal( '', $user ); + } } $result = $this->editPage( $pageName, $content, 'Summary', NS_MAIN, $user ); /** @var Status $result */ @@ -62,15 +66,20 @@ class ApiCoreThankIntegrationTest extends ApiTestCase { $user ); - $error = ''; // passed by reference - $deleteStatus = $pageToDelete->doDeleteArticleReal( - '', - false, - null, - null, - $error, - $user - ); + if ( version_compare( MW_VERSION, '1.35', '<' ) ) { + $error = ''; // passed by reference + $deleteStatus = $pageToDelete->doDeleteArticleReal( + '', + false, + null, + null, + $error, + $user + ); + } else { + $deleteStatus = $pageToDelete->doDeleteArticleReal( '', $user ); + } + $this->logId = $deleteStatus->getValue(); DeferredUpdates::clearPendingUpdates();