1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<?php
namespace Doctrine\Tests\Common\Cache;
use Doctrine\Common\Cache\RedisCache;
class RedisCacheTest extends CacheTest
{
private $_redis;
public function setUp()
{
if (extension_loaded('redis')) {
$this->_redis = new \Redis();
$ok = @$this->_redis->connect('127.0.0.1');
if (!$ok) {
$this->markTestSkipped('The ' . __CLASS__ .' requires the use of redis');
}
} else {
$this->markTestSkipped('The ' . __CLASS__ .' requires the use of redis');
}
}
protected function _getCacheDriver()
{
$driver = new RedisCache();
$driver->setRedis($this->_redis);
return $driver;
}
}
|