abstract class BaseFileCacheTest in Plug 7
Hierarchy
- class \Doctrine\Tests\Common\Cache\CacheTest extends \Doctrine\Tests\DoctrineTestCase
- class \Doctrine\Tests\Common\Cache\BaseFileCacheTest
Expanded class hierarchy of BaseFileCacheTest
File
- lib/
doctrine/ cache/ tests/ Doctrine/ Tests/ Common/ Cache/ BaseFileCacheTest.php, line 8
Namespace
Doctrine\Tests\Common\CacheView source
abstract class BaseFileCacheTest extends CacheTest {
protected $directory;
public function setUp() {
do {
$this->directory = sys_get_temp_dir() . '/doctrine_cache_' . uniqid();
} while (file_exists($this->directory));
}
public function tearDown() {
if (!is_dir($this->directory)) {
return;
}
$iterator = new RecursiveDirectoryIterator($this->directory);
foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {
if ($file
->isFile()) {
@unlink($file
->getRealPath());
}
elseif ($file
->isDir()) {
@rmdir($file
->getRealPath());
}
}
}
protected function isSharedStorage() {
return false;
}
}