Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / includes / objectcache / SqlBagOStuffMultiPrimaryIntegrationTest.php
blob47e0f5453e63fb98ff4d16ef8a8c39259bf13149
1 <?php
3 /**
4 * @group BagOStuff
5 * @group Database
6 * @covers \SqlBagOStuff
7 */
8 class SqlBagOStuffMultiPrimaryIntegrationTest extends BagOStuffTestBase {
9 protected function newCacheInstance() {
10 return $this->getServiceContainer()->getObjectCacheFactory()->newFromParams( [
11 'class' => SqlBagOStuff::class,
12 'loggroup' => 'SQLBagOStuff',
13 'multiPrimaryMode' => true,
14 'purgePeriod' => 0,
15 'reportDupes' => false
16 ] );
19 public function testModtoken() {
20 $now = self::TEST_TIME;
21 $this->cache->setMockTime( $now );
22 $this->cache->set( 'test', 'a' );
23 $this->assertSame( 'a', $this->cache->get( 'test' ) );
25 $now--;
26 // Modtoken comparison makes this a no-op
27 $this->cache->set( 'test', 'b' );
28 $this->assertSame( 'a', $this->cache->get( 'test' ) );
30 $now += 2;
31 $this->cache->set( 'test', 'c' );
32 $this->assertSame( 'c', $this->cache->get( 'test' ) );