Beispiel #1
0
 /**
  * Teardown environment
  *
  * @return void
  */
 protected function tearDown()
 {
     $cache = new CCache();
     $cache->setDir(CACHE_PATH);
     $this->removeFilesInCacheDir();
     $cache->removeSubdir(self::DUMMY);
 }
Beispiel #2
0
 /**
  * Test
  *
  * @return void
  */
 public function testCreateSubdir()
 {
     $cache = new CCache();
     $cache->setDir(CACHE_PATH);
     $subdir = "__test__";
     $cache->removeSubdir($subdir);
     $exp = "does not exist";
     $res = $cache->getStatusOfSubdir($subdir, false);
     $this->assertEquals($exp, $res, "Subdir should not be created.");
     $res = $cache->getPathToSubdir($subdir);
     $exp = realpath(CACHE_PATH . "/{$subdir}");
     $this->assertEquals($exp, $res, "Subdir path missmatch.");
     $exp = "exists, writable";
     $res = $cache->getStatusOfSubdir($subdir);
     $this->assertEquals($exp, $res, "Subdir should exist.");
     $res = $cache->removeSubdir($subdir);
     $this->assertTrue($res, "Remove subdir.");
 }