aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-12-03 18:29:32 +0100
committerLouis Chemineau <louis@chmn.me>2024-12-03 18:29:32 +0100
commit425e0c3660fb61d9eab816cd76f1d26a7c8118e4 (patch)
tree562d8c15f74886c2e8f7170f81ab6cb0f29aa70f
parent199b0bd4d9d32bab41c308515a23facd38c8331e (diff)
downloadnextcloud-server-425e0c3660fb61d9eab816cd76f1d26a7c8118e4.tar.gz
nextcloud-server-425e0c3660fb61d9eab816cd76f1d26a7c8118e4.zip
test(View): Copy preserves content
Signed-off-by: Louis Chemineau <louis@chmn.me>
-rw-r--r--tests/lib/Files/ViewTest.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php
index 4c61278c674..c4dcc07a007 100644
--- a/tests/lib/Files/ViewTest.php
+++ b/tests/lib/Files/ViewTest.php
@@ -2831,4 +2831,12 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals('foo.png', $folderData[1]['name']);
$this->assertEquals('foo.txt', $folderData[2]['name']);
}
+
+ public function testCopyPreservesContent() {
+ $viewUser1 = new View('/' . 'userId' . '/files');
+ $viewUser1->mkdir('');
+ $viewUser1->file_put_contents('foo.txt', 'foo');
+ $viewUser1->copy('foo.txt', 'bar.txt');
+ $this->assertEquals('foo', $viewUser1->file_get_contents('bar.txt'));
+ }
}