public function testHasStack() { LayerCache::forSource([new FakeSource(), 'get'])->toStack('X'); $this->assertTrue(LayerCache::hasStack('X')); $this->assertFalse(LayerCache::hasStack('Y')); }
public function testAddLayerWithNamedCache() { $cache = $this->getMock('FakeCache', ['get']); $cache->expects($this->once())->method('get')->with('kee')->will($this->returnValue(serialize(['d' => 'DATA', 'e' => time() + 10]))); LayerCache::registerCache('cache1', $cache); LayerCache::forSource([new FakeSource(), 'get'])->addLayer('cache1')->toStack('named'); $stack = LayerCache::stack('named'); $v = $stack->get('kee'); $this->assertSame('DATA', $v); }