示例#1
0
 public function testShouldReturnRelativePathToFile()
 {
     $local = \Vegas\Filesystem\Adapter\Local::setup(['directory' => TESTS_ROOT_DIR . '/fixtures/tmp']);
     $local->write('test.txt', 'Test file');
     $_SERVER['DOCUMENT_ROOT'] = TESTS_ROOT_DIR;
     $this->assertEquals('/fixtures/tmp/test.txt', $local->getUrl('test.txt', ['relative' => true]));
     $local->delete('test.txt');
 }
示例#2
0
 public function testObjectInstantiate()
 {
     $filesystem = $this->getFilesystem();
     $local = $filesystem->local;
     $local2 = $filesystem->local;
     $this->assertTrue($this->compareRefs($local, $local2));
     $local3 = \Vegas\Filesystem\Adapter\Local::setup(['directory' => TESTS_ROOT_DIR . '/fixtures/tmp']);
     $this->assertFalse($this->compareRefs($local, $local3));
     $this->assertFalse($this->compareRefs($local2, $local3));
 }