|
|
@@ -329,6 +329,19 @@ class RedisEngineTest extends TestCase
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * testDeleteCacheAsync method
|
|
|
+ */
|
|
|
+ public function testDeleteCacheAsync(): void
|
|
|
+ {
|
|
|
+ $data = 'this is a test of the emergency broadcasting system';
|
|
|
+ $result = Cache::write('delete_async_test', $data, 'redis');
|
|
|
+ $this->assertTrue($result);
|
|
|
+
|
|
|
+ $result = Cache::pool('redis')->deleteAsync('delete_async_test');
|
|
|
+ $this->assertTrue($result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* testDecrement method
|
|
|
*/
|
|
|
public function testDecrement(): void
|
|
|
@@ -452,6 +465,32 @@ class RedisEngineTest extends TestCase
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * testClearBlocking method
|
|
|
+ */
|
|
|
+ public function testClearBlocking(): void
|
|
|
+ {
|
|
|
+ Cache::setConfig('redis_clear_blocking', [
|
|
|
+ 'engine' => 'Redis',
|
|
|
+ 'prefix' => 'cake2_',
|
|
|
+ 'duration' => 3600,
|
|
|
+ 'port' => $this->port,
|
|
|
+ ]);
|
|
|
+
|
|
|
+ Cache::write('some_value', 'cache1', 'redis');
|
|
|
+ $result = Cache::pool('redis')->clearBlocking();
|
|
|
+ $this->assertTrue($result);
|
|
|
+ $this->assertNull(Cache::read('some_value', 'redis'));
|
|
|
+
|
|
|
+ Cache::write('some_value', 'cache2', 'redis_clear_blocking');
|
|
|
+ $result = Cache::pool('redis')->clearBlocking();
|
|
|
+ $this->assertTrue($result);
|
|
|
+ $this->assertNull(Cache::read('some_value', 'redis'));
|
|
|
+ $this->assertSame('cache2', Cache::read('some_value', 'redis_clear_blocking'));
|
|
|
+
|
|
|
+ Cache::pool('redis_clear_blocking')->clearBlocking();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* test that a 0 duration can successfully write.
|
|
|
*/
|
|
|
public function testZeroDuration(): void
|