public function testMirrorCopiesRelativeLinkedContents() { $this->markAsSkippedIfSymlinkIsMissing(); $sourcePath = $this->workspace . DIRECTORY_SEPARATOR . 'source' . DIRECTORY_SEPARATOR; $oldPath = getcwd(); mkdir($sourcePath . 'nested/', 0777, true); file_put_contents($sourcePath . '/nested/file1.txt', 'FILE1'); // Note: Create relative symlink chdir($sourcePath); symlink('nested', 'link1'); chdir($oldPath); $targetPath = $this->workspace . DIRECTORY_SEPARATOR . 'target' . DIRECTORY_SEPARATOR; $this->filesystem->mirror($sourcePath, $targetPath); $this->assertTrue(is_dir($targetPath)); $this->assertFileEquals($sourcePath . '/nested/file1.txt', $targetPath . DIRECTORY_SEPARATOR . 'link1/file1.txt'); $this->assertTrue(is_link($targetPath . DIRECTORY_SEPARATOR . 'link1')); $this->assertEquals($sourcePath . 'nested', readlink($targetPath . DIRECTORY_SEPARATOR . 'link1')); }