/** * @test */ public function expiredEntriesAreSkippedWhenIterating() { $this->backend->set('entry1', 'foo', [], 1); sleep(2); $this->assertFalse($this->backend->has('entry1')); $actualEntries = []; foreach ($this->backend as $key => $value) { $actualEntries[] = $key; } $this->assertEmpty($actualEntries, 'Entries should be empty'); }
/** * @test */ public function hasInvokesRedis() { $this->redis->expects($this->once())->method('exists')->with('Foo_Cache:entry:foo')->will($this->returnValue(true)); $this->assertEquals(true, $this->backend->has('foo')); }