diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-10-29 11:33:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-29 11:33:12 +0100 |
commit | e3e22e28c08c71df44897d2f45475f2069b90ea8 (patch) | |
tree | 4fd1012aea7093c3799cb8efc515ae99b0e9d3fb /tests/lib | |
parent | 73fdf2c150248bf6a560c82ee380258c6e916e11 (diff) | |
parent | 7cb07bf3065aaa4204b972f68d95b8d05991a963 (diff) | |
download | nextcloud-server-e3e22e28c08c71df44897d2f45475f2069b90ea8.tar.gz nextcloud-server-e3e22e28c08c71df44897d2f45475f2069b90ea8.zip |
Merge pull request #47847 from nextcloud/fix-copying-or-moving-from-shared-groupfolders
Diffstat (limited to 'tests/lib')
-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 43dfc1d1713..65bc538ef17 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')); + } } |