public function testWhenCopyFailsItRaisesAnException() { $fileSystem = $this->getFilesystem(); $localFile = new FileNode($fileSystem, 'some/random'); $newPath = new FileNode($fileSystem, 'some/target'); $fileSystem->shouldReceive('copy')->with($localFile->getPath(), $newPath->getPath())->andReturn(false); $this->expectException(CopyFailedException::class); $localFile->copy($newPath->getPath()); }