diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2024-04-14 20:39:18 +0200 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2024-04-14 18:48:21 +0000 |
commit | 82134d5837a456b1a16106dce7d4ff94b6e6014d (patch) | |
tree | 140112839e6cbf46b373b68082c4de6c29e7467e /tests/phpunit/includes/api/ApiComparePagesTest.php | |
parent | 6782074aad2782e4060c9cb7d71166561a610aeb (diff) | |
download | mediawikicore-82134d5837a456b1a16106dce7d4ff94b6e6014d.tar.gz mediawikicore-82134d5837a456b1a16106dce7d4ff94b6e6014d.zip |
tests: Migrate to IDatabase::newUpdateQueryBuilder
Bug: T353219
Change-Id: Icecc444e6b4d6d2e9f4b13cda2931b10bb753318
Diffstat (limited to 'tests/phpunit/includes/api/ApiComparePagesTest.php')
-rw-r--r-- | tests/phpunit/includes/api/ApiComparePagesTest.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/phpunit/includes/api/ApiComparePagesTest.php b/tests/phpunit/includes/api/ApiComparePagesTest.php index 6969c719f155..16813ba4a25a 100644 --- a/tests/phpunit/includes/api/ApiComparePagesTest.php +++ b/tests/phpunit/includes/api/ApiComparePagesTest.php @@ -63,12 +63,12 @@ class ApiComparePagesTest extends ApiTestCase { self::$repl['revB4'] => '20040404044404', ]; foreach ( $updateTimestamps as $id => $ts ) { - $this->db->update( - 'revision', - [ 'rev_timestamp' => $this->db->timestamp( $ts ) ], - [ 'rev_id' => $id ], - __METHOD__ - ); + $this->db->newUpdateQueryBuilder() + ->update( 'revision' ) + ->set( [ 'rev_timestamp' => $this->db->timestamp( $ts ) ] ) + ->where( [ 'rev_id' => $id ] ) + ->caller( __METHOD__ ) + ->execute(); } self::$repl['revC1'] = $this->addPage( 'C', 'C 1' ); @@ -89,9 +89,12 @@ class ApiComparePagesTest extends ApiTestCase { self::$repl['revE3'] = $this->addPage( 'E', 'E 3' ); self::$repl['revE4'] = $this->addPage( 'E', 'E 4' ); self::$repl['pageE'] = Title::makeTitle( NS_MAIN, 'ApiComparePagesTest E' )->getArticleID(); - $this->getDb()->update( - 'page', [ 'page_latest' => 0 ], [ 'page_id' => self::$repl['pageE'] ] - ); + $this->getDb()->newUpdateQueryBuilder() + ->update( 'page' ) + ->set( [ 'page_latest' => 0 ] ) + ->where( [ 'page_id' => self::$repl['pageE'] ] ) + ->caller( __METHOD__ ) + ->execute(); self::$repl['revF1'] = $this->addPage( 'F', "== Section 1 ==\nF 1.1\n\n== Section 2 ==\nF 1.2" ); self::$repl['pageF'] = Title::makeTitle( NS_MAIN, 'ApiComparePagesTest F' )->getArticleID(); |