/** * Teardown environment * * @return void */ protected function tearDown() { $cache = new CCache(); $cache->setDir(CACHE_PATH); $this->removeFilesInCacheDir(); $cache->removeSubdir(self::DUMMY); }
/** * 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."); }