|
|
|
|
@ -22,6 +22,7 @@ namespace Test\Files\ObjectStore;
|
|
|
|
|
|
|
|
|
|
use OC\Files\ObjectStore\StorageObjectStore;
|
|
|
|
|
use OC\Files\Storage\Temporary;
|
|
|
|
|
use OC\Files\Storage\Wrapper\Jail;
|
|
|
|
|
use OCP\Files\ObjectStore\IObjectStore;
|
|
|
|
|
use Test\Files\Storage\Storage;
|
|
|
|
|
|
|
|
|
|
@ -204,4 +205,27 @@ class ObjectStoreStorageTest extends Storage {
|
|
|
|
|
$this->assertTrue($cache->inCache('foo'));
|
|
|
|
|
$this->assertTrue($cache->inCache('foo/test.txt'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testCopyBetweenJails() {
|
|
|
|
|
$this->instance->mkdir('a');
|
|
|
|
|
$this->instance->mkdir('b');
|
|
|
|
|
$jailA = new Jail([
|
|
|
|
|
'storage' => $this->instance,
|
|
|
|
|
'root' => 'a'
|
|
|
|
|
]);
|
|
|
|
|
$jailB = new Jail([
|
|
|
|
|
'storage' => $this->instance,
|
|
|
|
|
'root' => 'b'
|
|
|
|
|
]);
|
|
|
|
|
$jailA->mkdir('sub');
|
|
|
|
|
$jailA->file_put_contents('1.txt', '1');
|
|
|
|
|
$jailA->file_put_contents('sub/2.txt', '2');
|
|
|
|
|
$jailA->file_put_contents('sub/3.txt', '3');
|
|
|
|
|
|
|
|
|
|
$jailB->copyFromStorage($jailA, '', 'target');
|
|
|
|
|
|
|
|
|
|
$this->assertEquals('1', $this->instance->file_get_contents('b/target/1.txt'));
|
|
|
|
|
$this->assertEquals('2', $this->instance->file_get_contents('b/target/sub/2.txt'));
|
|
|
|
|
$this->assertEquals('3', $this->instance->file_get_contents('b/target/sub/3.txt'));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|