浏览代码

No need to access a private field used by PHPUnit.

Fixes #207.
Daniele Alessandri 10 年之前
父节点
当前提交
c1e641e356
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      tests/PHPUnit/PredisTestCase.php

+ 4 - 3
tests/PHPUnit/PredisTestCase.php

@@ -19,6 +19,7 @@ use Predis\Profile;
  */
 abstract class PredisTestCase extends \PHPUnit_Framework_TestCase
 {
+    protected $predisRequirements = array();
     protected $redisServerVersion = null;
 
     /**
@@ -263,7 +264,7 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase
             !empty($annotations['method']['requiresRedisVersion']) &&
             in_array('connected', $annotations['method']['group'])
         ) {
-            $this->required['requiresRedisVersion'] = $annotations['method']['requiresRedisVersion'][0];
+            $this->predisRequirements['requiresRedisVersion'] = $annotations['method']['requiresRedisVersion'][0];
         }
     }
 
@@ -272,12 +273,12 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase
      */
     protected function checkRequiredRedisVersion()
     {
-        if (!isset($this->required['requiresRedisVersion'])) {
+        if (!isset($this->predisRequirements['requiresRedisVersion'])) {
             return;
         }
 
         $srvVersion = $this->getRedisServerVersion();
-        $expectation = explode(' ', $this->required['requiresRedisVersion'], 2);
+        $expectation = explode(' ', $this->predisRequirements['requiresRedisVersion'], 2);
 
         if (count($expectation) === 1) {
             $expOperator = '>=';