public function Redis_Tests_Cache_AbstractFlushUnitTestCase::testFlushALot in Redis 7.2
Flushing more than 20 elements should switch to a pipeline that sends multiple DEL batches.
File
- lib/
Redis/ Tests/ Cache/ AbstractFlushUnitTestCase.php, line 184
Class
Code
public function testFlushALot() {
global $conf;
$conf['redis_flush_mode_cache'] = 2;
$backend = $this
->getBackend();
$cids = array();
for ($i = 0; $i < 100; ++$i) {
$cids[] = $cid = 'test' . $i;
$backend
->set($cid, 42, CACHE_PERMANENT);
}
$backend
->clear('*', true);
foreach ($cids as $cid) {
$this
->assertFalse($backend
->get($cid));
}
}