Extend APCu test with int CAS

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2016-12-21 21:06:29 +01:00
parent d5036fd4af
commit 065f2fbcc6
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 12 additions and 0 deletions

View File

@ -19,4 +19,16 @@ class APCuTest extends Cache {
}
$this->instance=new \OC\Memcache\APCu($this->getUniqueID());
}
public function testCasIntChanged() {
$this->instance->set('foo', 1);
$this->assertTrue($this->instance->cas('foo', 1, 2));
$this->assertEquals(2, $this->instance->get('foo'));
}
public function testCasIntNotChanged() {
$this->instance->set('foo', 1);
$this->assertFalse($this->instance->cas('foo', 2, 3));
$this->assertEquals(1, $this->instance->get('foo'));
}
}