diff options
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Files/ObjectStore/FailDeleteObjectStore.php | 4 | ||||
-rw-r--r-- | tests/lib/Files/ObjectStore/FailWriteObjectStore.php | 4 | ||||
-rw-r--r-- | tests/lib/Files/ObjectStore/ObjectStoreTest.php | 16 |
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php b/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php index 1a3477090b9..c755657faff 100644 --- a/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php +++ b/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php @@ -51,4 +51,8 @@ class FailDeleteObjectStore implements IObjectStore { public function objectExists($urn) { return $this->objectStore->objectExists($urn); } + + public function copyObject($from, $to) { + $this->objectStore->copyObject($from, $to); + } } diff --git a/tests/lib/Files/ObjectStore/FailWriteObjectStore.php b/tests/lib/Files/ObjectStore/FailWriteObjectStore.php index ad2350ea36b..b9c8751fda3 100644 --- a/tests/lib/Files/ObjectStore/FailWriteObjectStore.php +++ b/tests/lib/Files/ObjectStore/FailWriteObjectStore.php @@ -52,4 +52,8 @@ class FailWriteObjectStore implements IObjectStore { public function objectExists($urn) { return $this->objectStore->objectExists($urn); } + + public function copyObject($from, $to) { + $this->objectStore->copyObject($from, $to); + } } diff --git a/tests/lib/Files/ObjectStore/ObjectStoreTest.php b/tests/lib/Files/ObjectStore/ObjectStoreTest.php index 9300a9bdef6..4ec44eb410d 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreTest.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreTest.php @@ -108,4 +108,20 @@ abstract class ObjectStoreTest extends TestCase { $this->assertFalse($instance->objectExists('2')); } + + public function testCopy() { + $stream = $this->stringToStream('foobar'); + + $instance = $this->getInstance(); + + $instance->writeObject('source', $stream); + + $this->assertFalse($instance->objectExists('target')); + + $instance->copyObject('source', 'target'); + + $this->assertTrue($instance->objectExists('target')); + + $this->assertEquals('foobar', stream_get_contents($instance->readObject('target'))); + } } |