No need to access a private field used by PHPUnit.

Fixes #207.
This commit is contained in:
Daniele Alessandri
2015-01-02 12:20:00 +01:00
parent 75ca2f8111
commit e4b0512d42
+4 -3
View File
@@ -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 = '>=';