Removed redundant constants

This commit is contained in:
vladvildanov
2023-08-01 12:47:47 +03:00
parent 5cf122ad71
commit 02b765d7cf
2 changed files with 1 additions and 22 deletions
-1
View File
@@ -49,7 +49,6 @@
<php>
<const name="REDIS_SERVER_HOST" value="127.0.0.1" />
<const name="REDIS_SERVER_PORT" value="6379" />
<const name="REDIS_SERVER_GEARS_PORT" value="6380" />
<const name="REDIS_SERVER_DBNUM" value="0" />
<env name="USE_RELAY" value="false" />
+1 -21
View File
@@ -176,9 +176,7 @@ abstract class PredisTestCase extends \PHPUnit\Framework\TestCase
return [
'scheme' => 'tcp',
'host' => constant('REDIS_SERVER_HOST'),
'port' => ($this->isRedisGearsTest())
? constant('REDIS_SERVER_GEARS_PORT')
: constant('REDIS_SERVER_PORT'),
'port' => constant('REDIS_SERVER_PORT'),
'database' => constant('REDIS_SERVER_DBNUM'),
];
}
@@ -581,24 +579,6 @@ abstract class PredisTestCase extends \PHPUnit\Framework\TestCase
&& in_array('cluster', $annotations['method']['group'], true);
}
/**
* Check annotations if it's matches to redis gears test scenario.
*
* @return bool
*/
protected function isRedisGearsTest(): bool
{
$annotations = TestUtil::parseTestMethodAnnotations(
get_class($this),
$this->getName(false)
);
return isset($annotations['method']['requiresRedisGearsVersion'], $annotations['method']['group'])
&& !empty($annotations['method']['requiresRedisGearsVersion'])
&& in_array('connected', $annotations['method']['group'], true)
&& in_array('gears', $annotations['method']['group'], true);
}
/**
* Parse comma-separated cluster endpoints and convert them into tcp strings.
*