Skip to content
Browse files

Fix Unit::_cleanUp() so "app/resources/tmp/tests/empty" file is not d…

…eleted on Windows.

Signed-off-by: David Persson <davidpersson@gmx.de>
  • Loading branch information...
1 parent 6dabd63 commit c7b08ddcfc401381a6b78e452bf91f52d0075d2f @ifunk ifunk committed with davidpersson Sep 26, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 test/Unit.php
View
5 test/Unit.php
@@ -1007,7 +1007,10 @@ protected function _cleanUp($path = null) {
$iterator = new RecursiveIteratorIterator($dirs, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($iterator as $item) {
- if ($item->getPathname() === "{$path}/empty" || $iterator->isDot()) {
+ /*
+ * Uses DIRECTORY_SEPARATOR to ensure correct path on Windows
+ */
+ if ($item->getPathname() === $path . DIRECTORY_SEPARATOR . 'empty' || $iterator->isDot()) {
continue;
}
($item->isDir()) ? rmdir($item->getPathname()) : unlink($item->getPathname());

0 comments on commit c7b08dd

Please sign in to comment.
Something went wrong with that request. Please try again.