/** * Checks if the cache is still fresh. * * This implementation always returns true when debug is off and the * cache file exists. * * @return bool true if the cache is fresh, false otherwise */ public function isFresh() { if (!$this->debug && is_file($this->getPath())) { return true; } return parent::isFresh(); }
public function testCacheKeepsContent() { $cache = new ResourceCheckerConfigCache($this->cacheFile); $cache->write('FOOBAR'); $this->assertSame('FOOBAR', file_get_contents($cache->getPath())); }