wiki.techinc.nl/tests/phpunit/includes/objectcache/SqlBagOStuffMultiPrimaryIntegrationTest.php
Aaron Schulz cc1bb73490 objectcache: remove "multiPrimaryMode" DB type assertion
Since no mysql-specific queries are required, allow sqlite and
Postgres setups to use "multiPrimaryMode" for easier testing.

Avoid "CASE types text and integer cannot be matched" Postgres
error by making dbEncodeSerialValue() cast the result to a string
so that addQuotes() applies in buildUpsertSetForOverwrite().

Bug: T212129
Change-Id: Ic84a804c272a7070779c8d41d3a33003852d0839
2022-04-21 16:20:39 -07:00

24 lines
612 B
PHP

<?php
/**
* @group BagOStuff
* @group Database
* @covers SqlBagOStuff
*/
class SqlBagOStuffMultiPrimaryIntegrationTest extends BagOStuffTestBase {
protected function newCacheInstance() {
return ObjectCache::newFromParams( [
'class' => SqlBagOStuff::class,
'loggroup' => 'SQLBagOStuff',
'globalKeyLb' => [
'factory' => static function () {
return \Mediawiki\MediaWikiServices::getInstance()->getDBLoadBalancer();
}
],
'globalKeyLbDomain' => WikiMap::getCurrentWikiDbDomain()->getId(),
'multiPrimaryMode' => true,
'purgePeriod' => 0,
'reportDupes' => false
] );
}
}