public function testCopyNonEmptyDir() { $to_copy = new LocalDirectory($this->driver, basename($this->datadir) . '/ne-to-copy'); $copied = new LocalDirectory($this->driver, basename($this->datadir) . '/ne-copied'); $child = new LocalFile($this->driver, $to_copy->path . '/child'); $moved_child = new LocalFile($this->driver, $copied->path . '/child'); $child_dir = new LocalDirectory($this->driver, $to_copy->path . '/child-dir'); $moved_child_dir = new LocalDirectory($this->driver, $copied->path . '/child-dir'); $this->assertFalse($copied->exists); $to_copy->create(); $child->create(); $child_dir->create(); $this->assertTrue($to_copy->copy($copied)); $this->assertTrue($to_copy->exists); $this->assertTrue($copied->exists); $this->assertTrue($child->exists); $this->assertTrue($moved_child->exists); $this->assertTrue($child_dir->exists); $this->assertTrue($moved_child_dir->exists); }
public function testDelete() { $filename = "{$this->filename}-new-delete"; touch($filename); $file = new LocalFile($this->driver, $filename); $this->assertTrue($file->delete()); $this->assertFalse(file_exists($file->full_path)); }