diff options
Diffstat (limited to 'tests/lib/memcache/cache.php')
-rw-r--r-- | tests/lib/memcache/cache.php | 12 |
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) { |