/** * @test */ public function freezeInvokesRedis() { $this->redis->expects($this->once())->method('lRange')->with('Foo_Cache:entries', 0, -1)->will($this->returnValue(array('entry_1', 'entry_2'))); $this->redis->expects($this->exactly(2))->method('persist'); $this->redis->expects($this->once())->method('set')->with('Foo_Cache:frozen', TRUE); $this->backend->freeze(); }
/** * @test */ public function freezeFreezesTheCache() { $this->assertFalse($this->backend->isFrozen()); for ($i = 0; $i < 10; $i++) { $this->backend->set('entry_' . $i, 'foo'); } $this->backend->freeze(); $this->assertTrue($this->backend->isFrozen()); }