parent::setUp();
$this->cache = new WANObjectCache( [
- 'cache' => new HashBagOStuff(),
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => new HashBagOStuff()
] );
$wanCache = TestingAccessWrapper::newFromObject( $this->cache );
};
$cache = new NearExpiringWANObjectCache( [
- 'cache' => new HashBagOStuff(),
- 'pool' => 'empty',
+ 'cache' => new HashBagOStuff()
] );
$wasSet = 0;
};
$cache = new NearExpiringWANObjectCache( [
'cache' => new HashBagOStuff(),
- 'pool' => 'empty',
'asyncHandler' => $asyncHandler
] );
$this->assertEquals( $value, $v, "New value stored" );
$cache = new PopularityRefreshingWANObjectCache( [
- 'cache' => new HashBagOStuff(),
- 'pool' => 'empty'
+ 'cache' => new HashBagOStuff()
] );
$mockWallClock = $priorTime;
WANObjectCache::VALUE_KEY_PREFIX . 'k1' => 'val-id1',
WANObjectCache::VALUE_KEY_PREFIX . 'k2' => 'val-id2'
] );
- $wanCache = new WANObjectCache( [ 'cache' => $localBag, 'pool' => 'testcache-hash' ] );
+ $wanCache = new WANObjectCache( [ 'cache' => $localBag ] );
// Warm the process cache
$keyedIds = new ArrayIterator( [ 'k1' => 'id1', 'k2' => 'id2' ] );
->willReturn( false );
$wanCache = new WANObjectCache( [
- 'cache' => $backend,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => $backend
] );
$isStale = null;
$localBag->expects( $this->never() )->method( 'delete' );
$wanCache = new WANObjectCache( [
'cache' => $localBag,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] ),
'mcrouterAware' => true,
'region' => 'pmtpa',
'cluster' => 'mw-wan'
->setMethods( [ 'set' ] )->getMock();
$wanCache = new WANObjectCache( [
'cache' => $localBag,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] ),
'mcrouterAware' => true,
'region' => 'pmtpa',
'cluster' => 'mw-wan'
->setMethods( [ 'set' ] )->getMock();
$wanCache = new WANObjectCache( [
'cache' => $localBag,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] ),
'mcrouterAware' => true,
'region' => 'pmtpa',
'cluster' => 'mw-wan'
->setMethods( [ 'delete' ] )->getMock();
$wanCache = new WANObjectCache( [
'cache' => $localBag,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] ),
'mcrouterAware' => true,
'region' => 'pmtpa',
'cluster' => 'mw-wan'
public function testEpoch() {
$bag = new HashBagOStuff();
- $cache = new WANObjectCache( [ 'cache' => $bag, 'pool' => 'testcache-hash' ] );
+ $cache = new WANObjectCache( [ 'cache' => $bag ] );
$key = $cache->makeGlobalKey( 'The whole of the Law' );
$now = microtime( true );
$cache = new WANObjectCache( [
'cache' => $bag,
- 'pool' => 'testcache-hash',
'epoch' => $now - 3600
] );
$cache->setMockTime( $now );
$now += 30;
$cache = new WANObjectCache( [
'cache' => $bag,
- 'pool' => 'testcache-hash',
'epoch' => $now + 3600
] );
$cache->setMockTime( $now );
->willReturn( 'special' );
$wanCache = new WANObjectCache( [
- 'cache' => $backend,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => $backend
] );
$this->assertSame( 'special', $wanCache->makeKey( 'a', 'b' ) );
->willReturn( 'special' );
$wanCache = new WANObjectCache( [
- 'cache' => $backend,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => $backend
] );
$this->assertSame( 'special', $wanCache->makeGlobalKey( 'a', 'b' ) );
*/
public function testStatsKeyClass( $key, $class ) {
$wanCache = TestingAccessWrapper::newFromObject( new WANObjectCache( [
- 'cache' => new HashBagOStuff,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => new HashBagOStuff
] ) );
$this->assertEquals( $class, $wanCache->determineKeyClass( $key ) );