summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/files/view.php2
-rw-r--r--tests/lib/files/view.php3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/files/view.php b/lib/files/view.php
index 875a6c1a1f8..8a37a0bcc62 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -467,7 +467,7 @@ class View {
}
} else {
if ($this->is_dir($path1) && ($dh = $this->opendir($path1))) {
- $this->mkdir($path2);
+ $result = $this->mkdir($path2);
while ($file = readdir($dh)) {
if (!Filesystem::isIgnoredDir($file)) {
$result = $this->copy($path1 . '/' . $file, $path2 . '/' . $file);
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index 554bc7291ad..a51d99e793d 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -235,9 +235,12 @@ class View extends \PHPUnit_Framework_TestCase {
\OC\Files\Filesystem::mount($storage2, array(), '/substorage');
$rootView = new \OC\Files\View('');
+ $rootView->mkdir('substorage/emptyfolder');
$rootView->copy('substorage', 'anotherfolder');
$this->assertTrue($rootView->is_dir('/anotherfolder'));
$this->assertTrue($rootView->is_dir('/substorage'));
+ $this->assertTrue($rootView->is_dir('/anotherfolder/emptyfolder'));
+ $this->assertTrue($rootView->is_dir('/substorage/emptyfolder'));
$this->assertTrue($rootView->file_exists('/anotherfolder/foo.txt'));
$this->assertTrue($rootView->file_exists('/anotherfolder/foo.png'));
$this->assertTrue($rootView->file_exists('/anotherfolder/folder/bar.txt'));