public function Redis_Tests_Cache_AbstractFlushUnitTestCase::doTestFlushPrefix in Redis 7.2
2 calls to Redis_Tests_Cache_AbstractFlushUnitTestCase::doTestFlushPrefix()
- Redis_Tests_Cache_AbstractFlushUnitTestCase::testFlushPrefixWithEval in lib/
Redis/ Tests/ Cache/ AbstractFlushUnitTestCase.php - Redis_Tests_Cache_AbstractFlushUnitTestCase::testFlushPrefixWithoutEval in lib/
Redis/ Tests/ Cache/ AbstractFlushUnitTestCase.php
File
- lib/
Redis/ Tests/ Cache/ AbstractFlushUnitTestCase.php, line 139
Class
Code
public function doTestFlushPrefix($withEval) {
global $conf;
$conf['redis_eval_enabled'] = $withEval;
$conf['redis_flush_mode_cache'] = 2;
$backend = $this
->getBackend();
$this
->assertEqual($withEval, $backend
->canUseEval());
$backend
->set('testprefix10', 'foo');
$backend
->set('testprefix11', 'foo');
$backend
->set('testprefix:12', 'bar');
$backend
->set('testprefix:13', 'baz');
$backend
->set('testnoprefix14', 'giraffe');
$backend
->set('testnoprefix:15', 'elephant');
$backend
->clear('testprefix:', true);
$this
->assertFalse($backend
->get('testprefix:12'));
$this
->assertFalse($backend
->get('testprefix:13'));
$this
->assertNotIdentical(false, $backend
->get('testprefix10'));
$this
->assertNotIdentical(false, $backend
->get('testprefix11'));
$this
->assertNotIdentical(false, $backend
->get('testnoprefix14'));
$this
->assertNotIdentical(false, $backend
->get('testnoprefix:15'));
$backend
->clear('testprefix', true);
$this
->assertFalse($backend
->get('testprefix10'));
$this
->assertFalse($backend
->get('testprefix11'));
$this
->assertNotIdentical(false, $backend
->get('testnoprefix14'));
$this
->assertNotIdentical(false, $backend
->get('testnoprefix:15'));
}