Files
Chamilo/vendor/knplabs/gaufrette/tests/Gaufrette/Functional/Adapter/SafeLocalTest.php
2025-08-14 22:41:49 +02:00

35 lines
737 B
PHP

<?php
namespace Gaufrette\Functional\Adapter;
use Gaufrette\Filesystem;
use Gaufrette\Adapter\SafeLocal;
class SafeLocalTest extends FunctionalTestCase
{
protected function setUp(): void
{
if (!file_exists($this->getDirectory())) {
mkdir($this->getDirectory());
}
$this->filesystem = new Filesystem(new SafeLocal($this->getDirectory()));
}
protected function tearDown(): void
{
foreach ($this->filesystem->keys() as $key) {
$this->filesystem->delete($key);
}
$this->filesystem = null;
rmdir($this->getDirectory());
}
private function getDirectory(): string
{
return sprintf('%s/filesystem', __DIR__);
}
}