From c812c5cf25eaea201abb485fb61b5edacefdf54c Mon Sep 17 00:00:00 2001 From: David Alger Date: Wed, 5 Mar 2014 15:27:05 -0600 Subject: [PATCH 01/11] Fixed #76: corrects the assumption that basename provides a unique comparison. --- src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php index 3b3f698f..bc82ddad 100644 --- a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php +++ b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php @@ -37,7 +37,7 @@ public function createDelegate($source, $dest) // Namespace/ModuleDir => Namespace/ModuleDir, but ModuleDir may exist if (file_exists($destPath) && is_dir($destPath)) { - if (basename($sourcePath) === basename($destPath)) { + if (strcmp($dest, $source) === 0) { // copy each child of $sourcePath into $destPath foreach (new \DirectoryIterator($sourcePath) as $item) { $item = (string) $item; From 18135b428e59c9e69b81b007b37838c60b54c8cf Mon Sep 17 00:00:00 2001 From: David Alger Date: Wed, 12 Mar 2014 16:44:58 -0500 Subject: [PATCH 02/11] Should resolve issue #76. Implements some improvements to path concatenation, utilizes the mapping from current iteration for comparison of directory paths. --- .../Composer/Magento/Deploystrategy/Copy.php | 11 +++++-- .../Deploystrategy/DeploystrategyAbstract.php | 31 ++++++++++++++++++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php index bc82ddad..cdec4851 100644 --- a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php +++ b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php @@ -20,6 +20,11 @@ class Copy extends DeploystrategyAbstract */ public function createDelegate($source, $dest) { + list($mapSource, $mapDest) = $this->getCurrentMapping(); + $mapSource = $this->removeTrailingSlash($mapSource); + $mapDest = $this->removeTrailingSlash($mapDest); + $cleanDest = $this->removeTrailingSlash($dest); + $sourcePath = $this->getSourceDir() . '/' . $this->removeTrailingSlash($source); $destPath = $this->getDestDir() . '/' . $this->removeTrailingSlash($dest); @@ -37,19 +42,19 @@ public function createDelegate($source, $dest) // Namespace/ModuleDir => Namespace/ModuleDir, but ModuleDir may exist if (file_exists($destPath) && is_dir($destPath)) { - if (strcmp($dest, $source) === 0) { + if (strcmp(substr($cleanDest, strlen($mapDest)+1), substr($source, strlen($mapSource)+1)) === 0) { // copy each child of $sourcePath into $destPath foreach (new \DirectoryIterator($sourcePath) as $item) { $item = (string) $item; if (!strcmp($item, '.') || !strcmp($item, '..')) { continue; } - $childSource = $source . '/' . $item; + $childSource = $this->removeTrailingSlash($source) . '/' . $item; $this->create($childSource, substr($destPath, strlen($this->getDestDir())+1)); } return true; } else { - $destPath .= '/' . basename($source); + $destPath = $this->removeTrailingSlash($destPath) . '/' . basename($source); return $this->create($source, substr($destPath, strlen($this->getDestDir())+1)); } } diff --git a/src/MagentoHackathon/Composer/Magento/Deploystrategy/DeploystrategyAbstract.php b/src/MagentoHackathon/Composer/Magento/Deploystrategy/DeploystrategyAbstract.php index b8a80b55..e003007a 100644 --- a/src/MagentoHackathon/Composer/Magento/Deploystrategy/DeploystrategyAbstract.php +++ b/src/MagentoHackathon/Composer/Magento/Deploystrategy/DeploystrategyAbstract.php @@ -17,6 +17,13 @@ abstract class DeploystrategyAbstract */ protected $mappings = array(); + /** + * The current mapping of the deployment iteration + * + * @var array + */ + protected $currentMapping = array(); + /** * The magento installation's base directory * @@ -59,6 +66,7 @@ public function deploy() { foreach ($this->getMappings() as $data) { list ($source, $dest) = $data; + $this->setCurrentMapping($data); $this->create($source, $dest); } return $this; @@ -139,6 +147,26 @@ public function setMappings(array $mappings) $this->mappings = $mappings; } + /** + * Gets the current mapping used on the deployment iteration + * + * @return array + */ + public function getCurrentMapping() + { + return $this->currentMapping; + } + + /** + * Sets the current mapping used on the deployment iteration + * + * @param array $mapping + */ + public function setCurrentMapping($mapping) + { + $this->currentMapping = $mapping; + } + /** * Add a key value pair to mapping */ @@ -159,6 +187,7 @@ protected function removeTrailingSlash($path) * * @param string $source * @param string $dest + * @throws \ErrorException * @return bool */ public function create($source, $dest) @@ -184,7 +213,7 @@ public function create($source, $dest) file app/etc/ --> link app/etc/file to file file app/etc/a --> link app/etc/a to file file app/etc/a --> if app/etc/a is a file throw exception unless force is set, in that case rm and see above - file app/etc/a/ --> link app/etc/a/file to file regardless if app/etc/a existst or not + file app/etc/a/ --> link app/etc/a/file to file regardless if app/etc/a exists or not */ From 66f061926cc77f64a5bd945a1ee0ebb34ec725a9 Mon Sep 17 00:00:00 2001 From: David Alger Date: Fri, 21 Mar 2014 15:32:09 -0500 Subject: [PATCH 03/11] Added calls to setCurrentMapping before calling create in test cases to account for new requirement. --- .../Composer/Magento/Deploystrategy/AbstractTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/AbstractTest.php b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/AbstractTest.php index 77ca87d3..b02082ff 100644 --- a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/AbstractTest.php +++ b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/AbstractTest.php @@ -146,6 +146,7 @@ public function testCreate() touch($this->sourceDir . DS . $src); $this->assertTrue(is_readable($this->sourceDir . DS . $src)); $this->assertFalse(is_readable($this->destDir . DS . $dest)); + $this->strategy->setCurrentMapping(array($src, $dest)); $this->strategy->create($src, $dest); $this->assertTrue(is_readable($this->destDir . DS . $dest)); } @@ -158,6 +159,7 @@ public function testCopyDirToDir() touch($this->sourceDir . DS . $src . DS . "local.xml"); $this->assertTrue(is_readable($this->sourceDir . DS . $src . DS . "local.xml")); $this->assertFalse(is_readable($this->destDir . DS . $dest . DS . "local.xml")); + $this->strategy->setCurrentMapping(array($src, $dest)); $this->strategy->create($src, $dest); $this->assertTrue(is_readable($this->destDir . DS . $dest . DS . "local.xml")); } @@ -173,6 +175,7 @@ public function testGlobTargetDirExists() $testTarget = $this->destDir . DS . $dest . DS . basename($globSource); + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); $this->assertFileType(dirname($testTarget), self::TEST_FILETYPE_DIR); @@ -192,6 +195,7 @@ public function testTargetDirWithChildDirExists() $testTarget = $this->destDir . DS . $dest . DS . basename($globSource) . DS . basename($sourceContents); + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); //passthru("tree {$this->destDir}/$dest"); @@ -211,6 +215,7 @@ public function testTargetDirWithChildDirNotExists() $testTarget = $this->destDir . DS . $dest . DS . basename($globSource) . DS . basename($sourceContents); + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); //passthru("tree {$this->destDir}/$dest"); @@ -228,6 +233,7 @@ public function testGlobTargetDirDoesNotExists() $testTarget = $this->destDir . DS . $dest; + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); $this->assertFileType(dirname($testTarget), self::TEST_FILETYPE_DIR); @@ -247,6 +253,7 @@ public function testGlobSlashDirectoryExists() $testTarget = $this->destDir . DS . $dest . basename($globSource); // second create has to identify symlink + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); $this->assertFileType(dirname($testTarget), self::TEST_FILETYPE_DIR); @@ -265,6 +272,7 @@ public function testGlobSlashDirectoryDoesNotExists() $testTarget = $this->destDir . DS . $dest . basename($globSource); // second create has to identify symlink + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); $this->assertFileType(dirname($testTarget), self::TEST_FILETYPE_DIR); @@ -284,6 +292,7 @@ public function testGlobWildcardTargetDirDoesNotExist() $dest = "targetdir"; + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); $targetDir = $this->destDir . DS . $dest; @@ -312,6 +321,7 @@ public function testGlobWildcardTargetDirDoesExist() $dest = "targetdir"; $this->mkdir($this->destDir . DS . $dest); + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); $targetDir = $this->destDir . DS . $dest; @@ -348,6 +358,7 @@ public function testSourceAndTargetAreDirsDoNotExist() $testTarget = $this->destDir . DS . $dest; $testTargetContent = $testTarget . DS . $sourceDirContent; + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); $this->assertFileExists($testTarget); @@ -383,6 +394,7 @@ public function testSourceAndTargetAreDirsDoExist() $testTarget = $this->destDir . DS . $dest . DS . basename($globSource); $testTargetContent = $testTarget . DS . $sourceDirContent; + $this->strategy->setCurrentMapping(array($globSource, $dest)); $this->strategy->create($globSource, $dest); $this->assertFileExists($testTarget); From 7a9ff2d7332bc3f5ff7c7ad19272fc659ca86005 Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 27 Mar 2014 16:16:41 -0500 Subject: [PATCH 04/11] Added unit test for issue #76 to verify solution. --- .../Magento/Deploystrategy/CopyTest.php | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php index 7c2cbcdf..e006310d 100644 --- a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php +++ b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php @@ -23,4 +23,27 @@ public function getTestDeployStrategyFiletype($isDir = false) return self::TEST_FILETYPE_FILE; } -} \ No newline at end of file + + public function testCopyDirToDirOfSameName() + { + $sourceRoot = 'root'; + $sourceContents = "subdir/subdir/test.xml"; + + $this->mkdir($this->sourceDir . DS . $sourceRoot . DS . dirname($sourceContents)); + touch($this->sourceDir . DS . $sourceRoot . DS . $sourceContents); + + // intentionally using a differnt name to verify solution doesn't rely on identical src/dest paths + $dest = "dest/root"; + $this->mkdir($this->destDir . DS . $dest); + + $testTarget = $this->destDir . DS . $dest . DS . $sourceContents; + $this->strategy->setCurrentMapping(array($sourceRoot, $dest)); + + $this->strategy->create($sourceRoot, $dest); + $this->assertFileExists($testTarget); + + $this->strategy->setIsForced(true); + $this->strategy->create($sourceRoot, $dest); + $this->assertFileNotExists(dirname(dirname($testTarget)) . DS . basename($testTarget)); + } +} From cfadb4319a70405d3a302da06e93946b5e4619e5 Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 27 Mar 2014 17:41:01 -0500 Subject: [PATCH 05/11] Resolves broken unit testTargetDirWithChildDirNotExists for issue 76. --- .../Composer/Magento/Deploystrategy/Copy.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php index cdec4851..2764d699 100644 --- a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php +++ b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php @@ -41,6 +41,14 @@ public function createDelegate($source, $dest) // Namespace/ModuleDir => Namespace/, but Namespace/ModuleDir may exist // Namespace/ModuleDir => Namespace/ModuleDir, but ModuleDir may exist + // first iteration through, we need to handle Namespace/ModuleDir => Namespace/ type glob + if ($mapSource == $source && $mapDest == $dest) { + if (basename($sourcePath) !== basename($destPath)) { + $this->setCurrentMapping(array($mapSource, $mapDest . '/' . basename($source))); + $cleanDest = $cleanDest . '/' . basename($source); + } + } + if (file_exists($destPath) && is_dir($destPath)) { if (strcmp(substr($cleanDest, strlen($mapDest)+1), substr($source, strlen($mapSource)+1)) === 0) { // copy each child of $sourcePath into $destPath From 6efc037b2beb76cc35e561e48caafbe140649ec3 Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 27 Mar 2014 16:16:41 -0500 Subject: [PATCH 06/11] Added unit test for issue #76 to verify solution. --- .../Magento/Deploystrategy/CopyTest.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php index 7c2cbcdf..16d03112 100644 --- a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php +++ b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php @@ -23,4 +23,26 @@ public function getTestDeployStrategyFiletype($isDir = false) return self::TEST_FILETYPE_FILE; } -} \ No newline at end of file + + public function testCopyDirToDirOfSameName() + { + $sourceRoot = 'root'; + $sourceContents = "subdir/subdir/test.xml"; + + $this->mkdir($this->sourceDir . DS . $sourceRoot . DS . dirname($sourceContents)); + touch($this->sourceDir . DS . $sourceRoot . DS . $sourceContents); + + // intentionally using a differnt name to verify solution doesn't rely on identical src/dest paths + $dest = "dest/root"; + $this->mkdir($this->destDir . DS . $dest); + + $testTarget = $this->destDir . DS . $dest . DS . $sourceContents; + + $this->strategy->create($sourceRoot, $dest); + $this->assertFileExists($testTarget); + + $this->strategy->setIsForced(true); + $this->strategy->create($sourceRoot, $dest); + $this->assertFileNotExists(dirname(dirname($testTarget)) . DS . basename($testTarget)); + } +} From 513ea31c360ba1c0b585cf66cc7ecc5720a26297 Mon Sep 17 00:00:00 2001 From: David Alger Date: Wed, 2 Apr 2014 16:35:01 -0500 Subject: [PATCH 07/11] Added tree output to issue-76 test to demonstrate issue. --- .../Composer/Magento/Deploystrategy/CopyTest.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php index 16d03112..fa0adf9e 100644 --- a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php +++ b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php @@ -28,21 +28,29 @@ public function testCopyDirToDirOfSameName() { $sourceRoot = 'root'; $sourceContents = "subdir/subdir/test.xml"; - + $this->mkdir($this->sourceDir . DS . $sourceRoot . DS . dirname($sourceContents)); touch($this->sourceDir . DS . $sourceRoot . DS . $sourceContents); - + // intentionally using a differnt name to verify solution doesn't rely on identical src/dest paths $dest = "dest/root"; $this->mkdir($this->destDir . DS . $dest); $testTarget = $this->destDir . DS . $dest . DS . $sourceContents; - + $this->strategy->create($sourceRoot, $dest); $this->assertFileExists($testTarget); - + + echo "\n\n -- 1st pass tree\n"; + passthru("tree {$this->destDir}/$dest"); + $this->strategy->setIsForced(true); $this->strategy->create($sourceRoot, $dest); + + + echo "\n\n -- 2nd pass tree\n"; + passthru("tree {$this->destDir}/$dest"); + $this->assertFileNotExists(dirname(dirname($testTarget)) . DS . basename($testTarget)); } } From e0f0fca951e55abe6e70b5136700e5bc5f46e90c Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 3 Apr 2014 11:15:11 -0500 Subject: [PATCH 08/11] Commented out testing code in unit test. --- .../Composer/Magento/Deploystrategy/CopyTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php index c82aa53d..4d61d7c0 100644 --- a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php +++ b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php @@ -42,15 +42,15 @@ public function testCopyDirToDirOfSameName() $this->strategy->create($sourceRoot, $dest); $this->assertFileExists($testTarget); - echo "\n\n -- 1st pass tree\n"; - passthru("tree {$this->destDir}/$dest"); + // echo "\n\n -- 1st pass tree\n"; + // passthru("tree {$this->destDir}/$dest"); $this->strategy->setIsForced(true); $this->strategy->create($sourceRoot, $dest); - echo "\n\n -- 2nd pass tree\n"; - passthru("tree {$this->destDir}/$dest"); + // echo "\n\n -- 2nd pass tree\n"; + // passthru("tree {$this->destDir}/$dest"); $this->assertFileNotExists(dirname(dirname($testTarget)) . DS . basename($testTarget)); } From f86d996ea7d1e2f4578b39b1851e80e1f76a73a2 Mon Sep 17 00:00:00 2001 From: David Alger Date: Fri, 4 Apr 2014 16:42:05 -0500 Subject: [PATCH 09/11] Fixed testGlobSlashDirectoryExists and testGlobSlashDirectoryDoesNotExists for issue 76 --- src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php index 2764d699..fa841151 100644 --- a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php +++ b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php @@ -42,7 +42,7 @@ public function createDelegate($source, $dest) // Namespace/ModuleDir => Namespace/ModuleDir, but ModuleDir may exist // first iteration through, we need to handle Namespace/ModuleDir => Namespace/ type glob - if ($mapSource == $source && $mapDest == $dest) { + if ($mapSource == $source && $mapDest == $this->removeTrailingSlash($dest)) { if (basename($sourcePath) !== basename($destPath)) { $this->setCurrentMapping(array($mapSource, $mapDest . '/' . basename($source))); $cleanDest = $cleanDest . '/' . basename($source); From e66a96fa092a502e17b37d29987c43abaf6be207 Mon Sep 17 00:00:00 2001 From: David Alger Date: Fri, 4 Apr 2014 17:00:48 -0500 Subject: [PATCH 10/11] Corrected testSourceAndTargetAreDirsDoExist for issue 76 --- src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php | 4 ++-- .../Composer/Magento/Deploystrategy/AbstractTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php index fa841151..888cf09d 100644 --- a/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php +++ b/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php @@ -41,8 +41,8 @@ public function createDelegate($source, $dest) // Namespace/ModuleDir => Namespace/, but Namespace/ModuleDir may exist // Namespace/ModuleDir => Namespace/ModuleDir, but ModuleDir may exist - // first iteration through, we need to handle Namespace/ModuleDir => Namespace/ type glob - if ($mapSource == $source && $mapDest == $this->removeTrailingSlash($dest)) { + // first iteration through, we need to update the mappings to correctly handle mismatch globs + if ($mapSource == $this->removeTrailingSlash($source) && $mapDest == $this->removeTrailingSlash($dest)) { if (basename($sourcePath) !== basename($destPath)) { $this->setCurrentMapping(array($mapSource, $mapDest . '/' . basename($source))); $cleanDest = $cleanDest . '/' . basename($source); diff --git a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/AbstractTest.php b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/AbstractTest.php index b02082ff..2d1d21ea 100644 --- a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/AbstractTest.php +++ b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/AbstractTest.php @@ -389,7 +389,7 @@ public function testSourceAndTargetAreDirsDoExist() $this->mkdir($this->destDir . DS . $dest); // The target should be created INSIDE the target directory because the target dir exists exist - // This is how bash commands (and therefore modman) process source and targer + // This is how bash commands (and therefore modman) process source and target $testTarget = $this->destDir . DS . $dest . DS . basename($globSource); $testTargetContent = $testTarget . DS . $sourceDirContent; From 9c52208e2d1db6334192b78f33eb8d15bc29b02f Mon Sep 17 00:00:00 2001 From: David Alger Date: Fri, 4 Apr 2014 17:05:56 -0500 Subject: [PATCH 11/11] Removed test code from unit test for issue 76 --- .../Composer/Magento/Deploystrategy/CopyTest.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php index 4d61d7c0..90c75881 100644 --- a/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php +++ b/tests/MagentoHackathon/Composer/Magento/Deploystrategy/CopyTest.php @@ -42,16 +42,9 @@ public function testCopyDirToDirOfSameName() $this->strategy->create($sourceRoot, $dest); $this->assertFileExists($testTarget); - // echo "\n\n -- 1st pass tree\n"; - // passthru("tree {$this->destDir}/$dest"); - $this->strategy->setIsForced(true); $this->strategy->create($sourceRoot, $dest); - - // echo "\n\n -- 2nd pass tree\n"; - // passthru("tree {$this->destDir}/$dest"); - $this->assertFileNotExists(dirname(dirname($testTarget)) . DS . basename($testTarget)); } }