X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Flibs%2Fobjectcache%2FReplicatedBagOStuffTest.php;h=550ec0bd0919d990f2ac6c689dd0048495a2a486;hp=b7f22ece94d51ce1febd006894155b7d51227af6;hb=f17f841a9dfa1bee3f8ed47a09f06d1226452573;hpb=0770f85a0a293e6c7af6f1d3d3a1dbd2d13c1e09 diff --git a/tests/phpunit/includes/libs/objectcache/ReplicatedBagOStuffTest.php b/tests/phpunit/includes/libs/objectcache/ReplicatedBagOStuffTest.php index b7f22ece94..550ec0bd09 100644 --- a/tests/phpunit/includes/libs/objectcache/ReplicatedBagOStuffTest.php +++ b/tests/phpunit/includes/libs/objectcache/ReplicatedBagOStuffTest.php @@ -23,40 +23,40 @@ class ReplicatedBagOStuffTest extends MediaWikiTestCase { * @covers ReplicatedBagOStuff::set */ public function testSet() { - $key = wfRandomString(); - $value = wfRandomString(); + $key = 'a key'; + $value = 'a value'; $this->cache->set( $key, $value ); // Write to master. - $this->assertEquals( $this->writeCache->get( $key ), $value ); + $this->assertEquals( $value, $this->writeCache->get( $key ) ); // Don't write to replica. Replication is deferred to backend. - $this->assertEquals( $this->readCache->get( $key ), false ); + $this->assertFalse( $this->readCache->get( $key ) ); } /** * @covers ReplicatedBagOStuff::get */ public function testGet() { - $key = wfRandomString(); + $key = 'a key'; - $write = wfRandomString(); + $write = 'one value'; $this->writeCache->set( $key, $write ); - $read = wfRandomString(); + $read = 'another value'; $this->readCache->set( $key, $read ); // Read from replica. - $this->assertEquals( $this->cache->get( $key ), $read ); + $this->assertEquals( $read, $this->cache->get( $key ) ); } /** * @covers ReplicatedBagOStuff::get */ public function testGetAbsent() { - $key = wfRandomString(); - $value = wfRandomString(); + $key = 'a key'; + $value = 'a value'; $this->writeCache->set( $key, $value ); // Don't read from master. No failover if value is absent. - $this->assertEquals( $this->cache->get( $key ), false ); + $this->assertFalse( $this->cache->get( $key ) ); } }