summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-06-08 15:25:23 +0200
committerRobin Appelman <icewind@owncloud.com>2015-06-12 17:28:09 +0200
commitac9f998abdceb21fbbda4e8dee0e8b16c2f5ec4e (patch)
tree844d7641ee0bc74edc874af3a0418cf175ac2b53 /tests
parent1bc56a99e9e368091753ff79facf930336478a35 (diff)
downloadnextcloud-server-ac9f998abdceb21fbbda4e8dee0e8b16c2f5ec4e.tar.gz
nextcloud-server-ac9f998abdceb21fbbda4e8dee0e8b16c2f5ec4e.zip
add compare-and-delete to the memcache interface
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/memcache/cache.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/lib/memcache/cache.php b/tests/lib/memcache/cache.php
index 9d977cf0247..3ff72ee931c 100644
--- a/tests/lib/memcache/cache.php
+++ b/tests/lib/memcache/cache.php
@@ -103,6 +103,18 @@ abstract class Cache extends \Test_Cache {
$this->assertEquals('bar1', $this->instance->get('foo'));
}
+ public function testCadNotChanged() {
+ $this->instance->set('foo', 'bar');
+ $this->assertTrue($this->instance->cad('foo', 'bar'));
+ $this->assertFalse($this->instance->hasKey('foo'));
+ }
+
+ public function testCadChanged() {
+ $this->instance->set('foo', 'bar1');
+ $this->assertFalse($this->instance->cad('foo', 'bar'));
+ $this->assertTrue($this->instance->hasKey('foo'));
+ }
+
protected function tearDown() {
if ($this->instance) {