public function testCopy() { $someFile = vfsStream::newFile('old.txt', 0777); $this->root->addChild($someFile); $subdir = vfsStream::newDirectory('subdir'); $this->root->addChild($subdir); $file = new File($someFile->url()); $newFile = $file->copy($subdir->url()); $this->assertTrue(file_exists($newFile->getPath())); $this->assertTrue(file_exists($file->getPath())); }