public function testClear() { Cache::write($this->cachedName, 'foo', 'bar'); Cache::write($this->cachedName, 'foobar', 'baz'); Cache::clear($this->cachedName); $result = Cache::read($this->cachedName, 'foo'); $this->assertNull($result); $result = Cache::read($this->cachedName, 'foobar'); $this->assertNull($result); }
public function testCacheWriteAndClear() { $config = array('default' => array('adapter' => 'Memory', 'filters' => array())); Cache::config($config); $result = Cache::config(); $expected = $config; $this->assertEqual($expected, $result); $result = Cache::clear('non_existing'); $this->assertFalse($result); $result = Cache::write('default', 'to delete', 'dead data', '+1 minute'); $this->assertTrue($result); $result = Cache::clear('default'); $this->assertTrue($result); $result = Cache::read('default', 'to delete'); $this->assertFalse($result); }