diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2024-04-14 21:33:50 +0200 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2024-04-14 21:56:07 +0200 |
commit | a89a00ffb8623a58fe8895342369c078f64f51d0 (patch) | |
tree | 8f835672ebe6f240ba9ec69eb133dba67853193e /tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php | |
parent | 6782074aad2782e4060c9cb7d71166561a610aeb (diff) | |
download | mediawikicore-a89a00ffb8623a58fe8895342369c078f64f51d0.tar.gz mediawikicore-a89a00ffb8623a58fe8895342369c078f64f51d0.zip |
tests: Migrate to IDatabase::newInsertQueryBuilder
Changed some inserts to use multi-row insert for small performance
benefit where possible and not already used.
InsertQueryBuilder does not return a value, deprecated since 1.33
Bug: T353219
Change-Id: I2380ebc8ec8db178dd790247aefbdd798b6d62ff
Diffstat (limited to 'tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php')
-rw-r--r-- | tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php b/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php index a2ae1497590c..62fb344ac059 100644 --- a/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php +++ b/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php @@ -193,29 +193,27 @@ class ApiQuerySiteinfoTest extends ApiTestCase { MainConfigNames::ScriptPath => '/w', ] ); - $this->getDb()->insert( - 'interwiki', - [ - [ - 'iw_prefix' => 'self', - 'iw_url' => 'https://local.example/w/index.php?title=$1', - 'iw_api' => 'https://local.example/w/api.php', - 'iw_wikiid' => 'somedbname', - 'iw_local' => true, - 'iw_trans' => true, - ], - [ - 'iw_prefix' => 'foreign', - 'iw_url' => '//foreign.example/wiki/$1', - 'iw_api' => '', - 'iw_wikiid' => '', - 'iw_local' => false, - 'iw_trans' => false, - ], - ], - __METHOD__, - 'IGNORE' - ); + $this->getDb()->newInsertQueryBuilder() + ->insertInto( 'interwiki' ) + ->ignore() + ->row( [ + 'iw_prefix' => 'self', + 'iw_url' => 'https://local.example/w/index.php?title=$1', + 'iw_api' => 'https://local.example/w/api.php', + 'iw_wikiid' => 'somedbname', + 'iw_local' => true, + 'iw_trans' => true, + ] ) + ->row( [ + 'iw_prefix' => 'foreign', + 'iw_url' => '//foreign.example/wiki/$1', + 'iw_api' => '', + 'iw_wikiid' => '', + 'iw_local' => false, + 'iw_trans' => false, + ] ) + ->caller( __METHOD__ ) + ->execute(); $this->getServiceContainer()->getMessageCache()->enable(); |