summaryrefslogtreecommitdiffstats
path: root/tests/lib/memcache/cache.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/memcache/cache.php')
-rw-r--r--tests/lib/memcache/cache.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/lib/memcache/cache.php b/tests/lib/memcache/cache.php
new file mode 100644
index 00000000000..2c1dbc9d2f7
--- /dev/null
+++ b/tests/lib/memcache/cache.php
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace Test\Memcache;
+
+class Cache extends \Test_Cache {
+ public function testExistsAfterSet() {
+ $this->assertFalse($this->instance->hasKey('foo'));
+ $this->instance->set('foo', 'bar');
+ $this->assertTrue($this->instance->hasKey('foo'));
+ }
+
+ public function testGetAfterSet() {
+ $this->assertNull($this->instance->get('foo'));
+ $this->instance->set('foo', 'bar');
+ $this->assertEquals('bar', $this->instance->get('foo'));
+ }
+
+ public function testDoesNotExistAfterRemove() {
+ $this->instance->set('foo', 'bar');
+ $this->instance->remove('foo');
+ $this->assertFalse($this->instance->hasKey('foo'));
+ }
+
+ public function tearDown() {
+ if ($this->instance) {
+ $this->instance->clear();
+ }
+ }
+}