mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-22 14:57:20 +00:00
test: Improved MemcachedEngineTest/MemcacheEngineTest.
This commit is contained in:
parent
d7d7230929
commit
bab8a84436
2 changed files with 8 additions and 0 deletions
|
@ -378,6 +378,10 @@ class MemcacheEngineTest extends CakeTestCase {
|
||||||
$this->assertEquals('cache1', Cache::read('some_value', 'memcache'));
|
$this->assertEquals('cache1', Cache::read('some_value', 'memcache'));
|
||||||
|
|
||||||
Cache::write('some_value', 'cache2', 'memcache2');
|
Cache::write('some_value', 'cache2', 'memcache2');
|
||||||
|
|
||||||
|
// Wait until the written key can be retrieved with Memcache::getExtendedStats(), as there may be a delay.
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
$result = Cache::clear(false, 'memcache');
|
$result = Cache::clear(false, 'memcache');
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
$this->assertFalse(Cache::read('some_value', 'memcache'));
|
$this->assertFalse(Cache::read('some_value', 'memcache'));
|
||||||
|
|
|
@ -686,6 +686,10 @@ class MemcachedEngineTest extends CakeTestCase {
|
||||||
$this->assertEquals('cache1', Cache::read('some_value', 'memcached'));
|
$this->assertEquals('cache1', Cache::read('some_value', 'memcached'));
|
||||||
|
|
||||||
Cache::write('some_value', 'cache2', 'memcached2');
|
Cache::write('some_value', 'cache2', 'memcached2');
|
||||||
|
|
||||||
|
// Wait until the written key can be retrieved with Memcached::getAllKeys(), as there may be a delay.
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
$result = Cache::clear(false, 'memcached');
|
$result = Cache::clear(false, 'memcached');
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
$this->assertFalse(Cache::read('some_value', 'memcached'));
|
$this->assertFalse(Cache::read('some_value', 'memcached'));
|
||||||
|
|
Loading…
Reference in a new issue