summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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) {