diff options
author | Robin Appelman <robin@icewind.nl> | 2024-10-02 17:00:53 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-10-10 15:16:12 +0200 |
commit | 7cb07bf3065aaa4204b972f68d95b8d05991a963 (patch) | |
tree | eb4cd9806a1119d6466f599560c5e7f847788514 | |
parent | 3017951d1df2ada5cd51c68781eafae05aa995d5 (diff) | |
download | nextcloud-server-7cb07bf3065aaa4204b972f68d95b8d05991a963.tar.gz nextcloud-server-7cb07bf3065aaa4204b972f68d95b8d05991a963.zip |
test: add test for nested jail cross-storage movefix-copying-or-moving-from-shared-groupfolders
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | tests/lib/Files/Storage/LocalTest.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/lib/Files/Storage/LocalTest.php b/tests/lib/Files/Storage/LocalTest.php index 4a98970f233..06e3d9f47e3 100644 --- a/tests/lib/Files/Storage/LocalTest.php +++ b/tests/lib/Files/Storage/LocalTest.php @@ -7,6 +7,8 @@ namespace Test\Files\Storage; +use OC\Files\Storage\Wrapper\Jail; + /** * Class LocalTest * @@ -135,4 +137,25 @@ class LocalTest extends Storage { // no exception thrown $this->assertNotNull($this->instance); } + + public function testMoveNestedJail(): void { + $this->instance->mkdir('foo'); + $this->instance->mkdir('foo/bar'); + $this->instance->mkdir('target'); + $this->instance->file_put_contents('foo/bar/file.txt', 'foo'); + $jail1 = new Jail([ + 'storage' => $this->instance, + 'root' => 'foo' + ]); + $jail2 = new Jail([ + 'storage' => $jail1, + 'root' => 'bar' + ]); + $jail3 = new Jail([ + 'storage' => $this->instance, + 'root' => 'target' + ]); + $jail3->moveFromStorage($jail2, 'file.txt', 'file.txt'); + $this->assertTrue($this->instance->file_exists('target/file.txt')); + } } |