FileTest.php 554 B

1234567891011121314151617181920
  1. <?php
  2. namespace Elgg\Filesystem;
  3. use Gaufrette\Adapter\InMemory;
  4. use Gaufrette\Filesystem as GaufretteFilesystem;
  5. use PHPUnit_Framework_TestCase as TestCase;
  6. class FileTest extends TestCase {
  7. public function testCanCheckForItsOwnExistence() {
  8. $directory = GaufretteDirectory::createInMemory();
  9. $directory->putContents('/foo/bar/bar.php', 'bar');
  10. $realfile = new File($directory, '/foo/bar/bar.php');
  11. $nonfile = new File($directory, '/foo/baz.php');
  12. $this->assertTrue($realfile->exists());
  13. $this->assertFalse($nonfile->exists());
  14. }
  15. }