mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 18:11:41 -04:00
test: add test for nested jail cross-storage move
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
3017951d1d
commit
7cb07bf306
1 changed files with 23 additions and 0 deletions
|
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue