/**
* @author Matthias Mullie <mmullie@wikimedia.org>
* @group BagOStuff
+ * @covers BagOStuff
*/
class BagOStuffTest extends MediaWikiTestCase {
/** @var BagOStuff */
}
/**
- * @covers BagOStuff::makeGlobalKey
- * @covers BagOStuff::makeKeyInternal
+ * @covers MediumSpecificBagOStuff::makeGlobalKey
+ * @covers MediumSpecificBagOStuff::makeKeyInternal
*/
public function testMakeKey() {
$cache = ObjectCache::newFromId( 'hash' );
}
/**
- * @covers BagOStuff::merge
- * @covers BagOStuff::mergeViaCas
+ * @covers MediumSpecificBagOStuff::merge
+ * @covers MediumSpecificBagOStuff::mergeViaCas
*/
public function testMerge() {
$key = $this->cache->makeKey( self::TEST_KEY );
}
/**
- * @covers BagOStuff::changeTTL
+ * @covers MediumSpecificBagOStuff::changeTTL
*/
public function testChangeTTL() {
$key = $this->cache->makeKey( self::TEST_KEY );
}
/**
- * @covers BagOStuff::changeTTLMulti
+ * @covers MediumSpecificBagOStuff::changeTTLMulti
*/
public function testChangeTTLMulti() {
$key1 = $this->cache->makeKey( 'test-key1' );
$this->assertFalse( $this->cache->get( $key2 ) );
$this->assertFalse( $this->cache->get( $key3 ) );
- $this->cache->setMulti( [
- $key1 => 1,
- $key2 => 2,
- $key3 => 3
- ] );
+ $ok = $this->cache->setMulti( [ $key1 => 1, $key2 => 2, $key3 => 3 ] );
+
+ $this->assertTrue( $ok, "setMulti() succeeded" );
+ $this->assertEquals(
+ 3,
+ count( $this->cache->getMulti( [ $key1, $key2, $key3 ] ) ),
+ "setMulti() succeeded via getMulti() check"
+ );
$ok = $this->cache->changeTTLMulti( [ $key1, $key2, $key3 ], 300 );
$this->assertTrue( $ok, "TTL bumped for all keys" );
}
/**
- * @covers BagOStuff::add
+ * @covers MediumSpecificBagOStuff::add
*/
public function testAdd() {
$key = $this->cache->makeKey( self::TEST_KEY );
}
/**
- * @covers BagOStuff::get
+ * @covers MediumSpecificBagOStuff::get
*/
public function testGet() {
$value = [ 'this' => 'is', 'a' => 'test' ];
}
/**
- * @covers BagOStuff::get
- * @covers BagOStuff::set
- * @covers BagOStuff::getWithSetCallback
+ * @covers MediumSpecificBagOStuff::get
+ * @covers MediumSpecificBagOStuff::set
+ * @covers MediumSpecificBagOStuff::getWithSetCallback
*/
public function testGetWithSetCallback() {
$key = $this->cache->makeKey( self::TEST_KEY );
}
/**
- * @covers BagOStuff::incr
+ * @covers MediumSpecificBagOStuff::incr
*/
public function testIncr() {
$key = $this->cache->makeKey( self::TEST_KEY );
}
/**
- * @covers BagOStuff::incrWithInit
+ * @covers MediumSpecificBagOStuff::incrWithInit
*/
public function testIncrWithInit() {
$key = $this->cache->makeKey( self::TEST_KEY );
}
/**
- * @covers BagOStuff::getMulti
+ * @covers MediumSpecificBagOStuff::getMulti
*/
public function testGetMulti() {
$value1 = [ 'this' => 'is', 'a' => 'test' ];
}
/**
- * @covers BagOStuff::setMulti
- * @covers BagOStuff::deleteMulti
+ * @covers MediumSpecificBagOStuff::setMulti
+ * @covers MediumSpecificBagOStuff::deleteMulti
*/
public function testSetDeleteMulti() {
$map = [
}
/**
- * @covers BagOStuff::get
- * @covers BagOStuff::getMulti
- * @covers BagOStuff::merge
- * @covers BagOStuff::delete
+ * @covers MediumSpecificBagOStuff::get
+ * @covers MediumSpecificBagOStuff::getMulti
+ * @covers MediumSpecificBagOStuff::merge
+ * @covers MediumSpecificBagOStuff::delete
*/
public function testSetSegmentable() {
$key = $this->cache->makeKey( self::TEST_KEY );
}
/**
- * @covers BagOStuff::getScopedLock
+ * @covers MediumSpecificBagOStuff::getScopedLock
*/
public function testGetScopedLock() {
$key = $this->cache->makeKey( self::TEST_KEY );
}
/**
- * @covers BagOStuff::__construct
- * @covers BagOStuff::trackDuplicateKeys
+ * @covers MediumSpecificBagOStuff::__construct
+ * @covers MediumSpecificBagOStuff::trackDuplicateKeys
*/
public function testReportDupes() {
$logger = $this->createMock( Psr\Log\NullLogger::class );
}
/**
- * @covers BagOStuff::lock()
- * @covers BagOStuff::unlock()
+ * @covers MediumSpecificBagOStuff::lock()
+ * @covers MediumSpecificBagOStuff::unlock()
*/
public function testLocking() {
$key = 'test';