setFile() public method

Defines a file.
public setFile ( string $key, string $content = null, integer $mtime = null )
$key string The key
$content string The content
$mtime integer The last modified time (automatically set to now if NULL)
Beispiel #1
0
 /**
  * @test
  */
 public function shouldNeedReloadAfterSourceChanged()
 {
     $source = new InMemory();
     $cache = new InMemory();
     $cachedFs = new Cache($source, $cache);
     // The source has been updated after the cache has been created.
     $mtime = time();
     $source->setFile('foo', 'baz', $mtime - 10);
     $cache->setFile('foo', 'bar', $mtime - 20);
     $this->assertTrue($cachedFs->needsReload('foo'));
     $this->assertEquals('baz', $cachedFs->read('foo'));
 }