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/EditPageConstraintsTest.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/EditPageConstraintsTest.php')
-rw-r--r-- | tests/phpunit/includes/EditPageConstraintsTest.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tests/phpunit/includes/EditPageConstraintsTest.php b/tests/phpunit/includes/EditPageConstraintsTest.php index f99963f67986..476a44c843a4 100644 --- a/tests/phpunit/includes/EditPageConstraintsTest.php +++ b/tests/phpunit/includes/EditPageConstraintsTest.php @@ -89,11 +89,11 @@ class EditPageConstraintsTest extends MediaWikiLangTestCase { // Set the latest timestamp back a while $dbw = wfGetDB( DB_PRIMARY ); - $dbw->update( - 'revision', - [ 'rev_timestamp' => $dbw->timestamp( '20120101000000' ) ], - [ 'rev_id' => $page->getLatest() ] - ); + $dbw->newUpdateQueryBuilder() + ->update( 'revision' ) + ->set( [ 'rev_timestamp' => $dbw->timestamp( '20120101000000' ) ] ) + ->where( [ 'rev_id' => $page->getLatest() ] ) + ->execute(); $page->clear(); $content = $page->getContent(); @@ -167,17 +167,16 @@ class EditPageConstraintsTest extends MediaWikiLangTestCase { // edit before it. Since the constraint will query for the most recent timestamp, // update *all* deletion logs for the page to the same timestamp (1 January 2020) $dbw = wfGetDB( DB_PRIMARY ); - $dbw->update( - 'logging', - [ 'log_timestamp' => $dbw->timestamp( '20200101000000' ) ], - [ + $dbw->newUpdateQueryBuilder() + ->update( 'logging' ) + ->set( [ 'log_timestamp' => $dbw->timestamp( '20200101000000' ) ] ) + ->where( [ 'log_namespace' => $title->getNamespace(), 'log_title' => $title->getDBkey(), 'log_type' => 'delete', - 'log_action' => 'delete' - ], - __METHOD__ - ); + 'log_action' => 'delete', + ] ) + ->caller( __METHOD__ )->execute(); $user = $this->getTestUser()->getUser(); |