Use new signature for WikiPage::doDeleteArticleReal in MW 1.35+

Bug: T247869
Change-Id: I606611d2cf5cd77c8cef68cc96def9207d2e5940
This commit is contained in:
DannyS712 2020-03-25 06:43:05 +00:00
parent ea29a94abc
commit 80fe5f9228

View file

@ -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();