summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-12-10 17:20:45 +0100
committerRobin Appelman <robin@icewind.nl>2018-12-12 14:17:19 +0100
commit6c9f2644cf8bac151b9af743802eb72a51278e8b (patch)
tree161b589821f998cc1e9bc7e7834730fadb5f5edb /tests
parent71df6233cfc4c6a02f90a887d57471430fe38dd7 (diff)
downloadnextcloud-server-6c9f2644cf8bac151b9af743802eb72a51278e8b.tar.gz
nextcloud-server-6c9f2644cf8bac151b9af743802eb72a51278e8b.zip
Add objectExists to objectstore interface
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/ObjectStore/ObjectStoreTest.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/lib/Files/ObjectStore/ObjectStoreTest.php b/tests/lib/Files/ObjectStore/ObjectStoreTest.php
index 2116306053e..1383c0149a2 100644
--- a/tests/lib/Files/ObjectStore/ObjectStoreTest.php
+++ b/tests/lib/Files/ObjectStore/ObjectStoreTest.php
@@ -94,4 +94,19 @@ abstract class ObjectStoreTest extends TestCase {
$this->assertEquals(1, 1);
}
}
+
+ public function testExists() {
+ $stream = $this->stringToStream('foobar');
+
+ $instance = $this->getInstance();
+ $this->assertFalse($instance->objectExists('2'));
+
+ $instance->writeObject('2', $stream);
+
+ $this->assertTrue($instance->objectExists('2'));
+
+ $instance->deleteObject('2');
+
+ $this->assertFalse($instance->objectExists('2'));
+ }
}