/** * testCopyWithOverwrite * * Verify that subdirectories existing in both destination and source directory * are overwritten/replaced recursively. * * @return void */ public function testCopyWithOverwrite() { extract($this->_setupFilesystem()); $Folder = new Folder($folderOne); $result = $Folder->copy(array('to' => $folderThree, 'scheme' => Folder::OVERWRITE)); $this->assertTrue(file_exists($folderThree . DS . 'file1.php')); $this->assertTrue(file_exists($folderThree . DS . 'folderA' . DS . 'fileA.php')); $Folder = new Folder($folderTwo); $result = $Folder->copy(array('to' => $folderThree, 'scheme' => Folder::OVERWRITE)); $this->assertTrue($result); $this->assertTrue(file_exists($folderThree . DS . 'folderA' . DS . 'fileA.php')); $Folder = new Folder($folderOne); unlink($fileOneA); $result = $Folder->copy(array('to' => $folderThree, 'scheme' => Folder::OVERWRITE)); $this->assertTrue($result); $this->assertTrue(file_exists($folderThree . DS . 'file1.php')); $this->assertTrue(file_exists($folderThree . DS . 'file2.php')); $this->assertTrue(!file_exists($folderThree . DS . 'folderA' . DS . 'fileA.php')); $this->assertTrue(file_exists($folderThree . DS . 'folderB' . DS . 'fileB.php')); }