Permalink
Browse files

Added tests

  • Loading branch information...
1 parent 68e48f9 commit 43ec9bb2bd4e857a8141b803f37ecc4f5d79a062 @o committed Feb 29, 2012
Showing with 30 additions and 0 deletions.
  1. +30 −0 tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php
@@ -0,0 +1,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;
+ }
+}

0 comments on commit 43ec9bb

Please sign in to comment.