20 'caches' => [ $this->cache1, $this->cache2 ],
21 'replication' =>
'async',
22 'asyncHandler' =>
'DeferredUpdates::addCallableUpdate'
36 $this->assertEquals(
$value, $this->cache1->get( $key ),
'Written to tier 1' );
38 $this->assertEquals(
$value, $this->cache2->get( $key ),
'Written to tier 2' );
54 $this->
cache->merge( $key, $func );
57 $this->assertEquals(
$value, $this->cache1->get( $key ),
'Written to tier 1' );
59 $this->assertEquals(
false, $this->cache2->get( $key ),
'Not written to tier 2' );
64 $this->assertEquals(
$value, $this->cache2->get( $key ),
'Written to tier 2' );
72 $this->assertEquals(
$value, $this->cache1->get( $key ),
'Written to tier 1' );
74 $this->assertEquals(
$value, $this->cache2->get( $key ),
'Written to tier 2' );
85 $expectValue = clone
$value;
96 $this->assertEquals( $expectValue, $this->cache1->get( $key ),
'Written to tier 1' );
98 $this->assertEquals(
false, $this->cache2->get( $key ),
'Not written to tier 2' );
103 $this->assertEquals( $expectValue, $this->cache2->get( $key ),
'Written to tier 2' );
111 ->setMethods( [
'makeKey' ] )->getMock();
112 $cache1->expects( $this->once() )->method(
'makeKey' )
113 ->willReturn(
'special' );
116 ->setMethods( [
'makeKey' ] )->getMock();
117 $cache2->expects( $this->never() )->method(
'makeKey' );
128 ->setMethods( [
'makeGlobalKey' ] )->getMock();
129 $cache1->expects( $this->once() )->method(
'makeGlobalKey' )
130 ->willReturn(
'special' );
133 ->setMethods( [
'makeGlobalKey' ] )->getMock();
134 $cache2->expects( $this->never() )->method(
'makeGlobalKey' );
144 'caches' => [ $bag, $bag ],
147 $this->assertTrue(
$cache->
add(
'key', 1, 30 ) );