Skip to content
Permalink
Browse files

fixed phpcs error, added test for move()

  • Loading branch information...
daniel-lang committed May 12, 2015
1 parent b970a0e commit 8bc4e71fe4beeefbf7e4f513ec59e23b99f3d994
Showing with 14 additions and 1 deletion.
  1. +1 −1 src/Filesystem/Folder.php
  2. +13 −0 tests/TestCase/Filesystem/FolderTest.php
@@ -725,7 +725,7 @@ public function copy($options)
$this->delete($to);
}
if(is_dir($from) && $options['recursive'] === false) {
if (is_dir($from) && $options['recursive'] === false) {
continue;
}
@@ -1045,6 +1045,7 @@ public function testCopyWithoutRecursive()
$result = $Folder->copy(['to' => $folderThree, 'recursive' => false]);
$this->assertTrue(file_exists($folderThree . DS . 'file1.php'));
$this->assertFalse(is_dir($folderThree . DS . 'folderA'));
$this->assertFalse(file_exists($folderThree . DS . 'folderA' . DS . 'fileA.php'));
}
@@ -1234,4 +1235,16 @@ public function testMoveWithSkip()
$Folder = new Folder($path);
$Folder->delete();
}
public function testMoveWithoutRecursive()
{
extract($this->_setupFilesystem());
$Folder = new Folder($folderOne);
$result = $Folder->move(['to' => $folderTwo, 'recursive' => false]);
$this->assertTrue($result);
$this->assertTrue(file_exists($folderTwo . '/file1.php'));
$this->assertFalse(is_dir($folderTwo . '/folderA'));
$this->assertFalse(file_exists($folderTwo . '/folderA/fileA.php'));
}
}

0 comments on commit 8bc4e71

Please sign in to comment.
You can’t perform that action at this time.