public function testLoadFromCacheWorks()
 {
     $file = 'test';
     $value = uniqid('test:');
     $o = new FileAccess('');
     $o->setCachePath(VSC_FIXTURE_PATH);
     $o->cacheFile($file, $value);
     $this->assertEquals($value, $o->loadFromCache($file));
     unlink(VSC_FIXTURE_PATH . $o->getSignature($file));
 }
Exemple #2
0
 public function testBasicCacheFile()
 {
     $value = uniqid('test:');
     $file = __FILE__;
     $o = new FileAccess(__FILE__);
     $o->setCachePath(VSC_FIXTURE_PATH);
     $o->cacheFile($file, $value);
     $sig = $o->getSignature($file);
     $this->assertTrue(is_file(VSC_FIXTURE_PATH . $sig));
     $this->assertEquals($value, file_get_contents(VSC_FIXTURE_PATH . $sig));
     unlink(VSC_FIXTURE_PATH . $sig);
 }
Exemple #3
0
 public function testBasicSetCachePath()
 {
     $o = new FileAccess(__FILE__);
     $o->setCachePath(VSC_FIXTURE_PATH);
     $this->assertEquals(VSC_FIXTURE_PATH, $o->getCachePath());
 }