예제 #1
0
 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));
 }
예제 #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);
 }
예제 #3
0
 public function testGetSignatureSameAsMD5OfPathDate()
 {
     $o = new FileAccess('');
     $this->assertEquals(md5(__FILE__ . date('Ymd')), $o->getSignature(__FILE__));
 }