LocalTest.php 767 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Gaufrette\Functional\FileStream;
  3. use Gaufrette\Filesystem;
  4. use Gaufrette\Adapter\Local as LocalAdapter;
  5. class LocalTest extends FunctionalTestCase
  6. {
  7. protected $directory;
  8. public function setUp()
  9. {
  10. $this->directory = __DIR__.DIRECTORY_SEPARATOR.'filesystem';
  11. @mkdir($this->directory);
  12. @chmod($this->directory, 0777);
  13. $this->filesystem = new Filesystem(new LocalAdapter($this->directory, true));
  14. $this->registerLocalFilesystemInStream();
  15. }
  16. public function tearDown()
  17. {
  18. if (is_file($file = $this->directory.DIRECTORY_SEPARATOR.'test.txt')) {
  19. @unlink($file);
  20. }
  21. if (is_dir($this->directory)) {
  22. @rmdir($this->directory);
  23. }
  24. }
  25. }