summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-04-29 16:34:36 +0200
committerRobin Appelman <icewind@owncloud.com>2015-04-30 14:48:39 +0200
commitacf30ede95f4b8986787f81edcf025a84237b7c5 (patch)
tree8bfd36e370c084793f98a6cf0366916ab27f66cb /tests
parent29213b6136a4b2f71e5f981e9bc08e3e76128d4e (diff)
downloadnextcloud-server-acf30ede95f4b8986787f81edcf025a84237b7c5.tar.gz
nextcloud-server-acf30ede95f4b8986787f81edcf025a84237b7c5.zip
add compare and swap to memcache
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 80ad182b6bf..9d977cf0247 100644
--- a/tests/lib/memcache/cache.php
+++ b/tests/lib/memcache/cache.php
@@ -91,6 +91,18 @@ abstract class Cache extends \Test_Cache {
$this->assertEquals('bar', $this->instance->get('foo'));
}
+ public function testCasNotChanged() {
+ $this->instance->set('foo', 'bar');
+ $this->assertTrue($this->instance->cas('foo', 'bar', 'asd'));
+ $this->assertEquals('asd', $this->instance->get('foo'));
+ }
+
+ public function testCasChanged() {
+ $this->instance->set('foo', 'bar1');
+ $this->assertFalse($this->instance->cas('foo', 'bar', 'asd'));
+ $this->assertEquals('bar1', $this->instance->get('foo'));
+ }
+
protected function tearDown() {
if ($this->instance) {