diff options
author | Amir Sarabadani <ladsgroup@gmail.com> | 2023-07-14 14:37:00 +0200 |
---|---|---|
committer | Amir Sarabadani <ladsgroup@gmail.com> | 2023-07-14 15:40:11 +0200 |
commit | 77342327ee23b4c02ddb1baa1fcdf0aa31862a2c (patch) | |
tree | 69180419370511b5faab86db3082f2972b58bb6a /tests/phpunit/includes/api/ApiStashEditTest.php | |
parent | 5551326fa05cdff429cde8b048b0ec9973c4e9bd (diff) | |
download | mediawikicore-77342327ee23b4c02ddb1baa1fcdf0aa31862a2c.tar.gz mediawikicore-77342327ee23b4c02ddb1baa1fcdf0aa31862a2c.zip |
tests: Migrate calls to Database::update to UpdateQueryBuilder
Bug: T330640
Change-Id: I30f9e84658fbd996b5512e96dda3f6412ebf3a20
Diffstat (limited to 'tests/phpunit/includes/api/ApiStashEditTest.php')
-rw-r--r-- | tests/phpunit/includes/api/ApiStashEditTest.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/phpunit/includes/api/ApiStashEditTest.php b/tests/phpunit/includes/api/ApiStashEditTest.php index 274bc88bfd2d..de8a0ac964bc 100644 --- a/tests/phpunit/includes/api/ApiStashEditTest.php +++ b/tests/phpunit/includes/api/ApiStashEditTest.php @@ -193,12 +193,11 @@ class ApiStashEditTest extends ApiTestCase { // Corrupt the database. @todo Does the API really need to fail gracefully for this case? $dbw = wfGetDB( DB_PRIMARY ); - $dbw->update( - 'page', - [ 'page_latest' => 0 ], - [ 'page_id' => $revRecord->getPageId() ], - __METHOD__ - ); + $dbw->newUpdateQueryBuilder() + ->update( 'page' ) + ->set( [ 'page_latest' => 0 ] ) + ->where( [ 'page_id' => $revRecord->getPageId() ] ) + ->caller( __METHOD__ )->execute(); $this->doStash( [ 'title' => $name, 'baserevid' => $revRecord->getId() ] ); } |