File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,12 @@ public function testCachePools()
26
26
27
27
/**
28
28
* @requires extension redis
29
+ * @group integration
29
30
*/
30
31
public function testRedisCachePools ()
31
32
{
33
+ $ this ->skipIfRedisUnavailable ();
34
+
32
35
try {
33
36
$ this ->doTestCachePools (['root_config ' => 'redis_config.yml ' , 'environment ' => 'redis_cache ' ], RedisAdapter::class);
34
37
} catch (\PHPUnit \Framework \Error \Warning $ e ) {
@@ -51,9 +54,12 @@ public function testRedisCachePools()
51
54
52
55
/**
53
56
* @requires extension redis
57
+ * @group integration
54
58
*/
55
59
public function testRedisCustomCachePools ()
56
60
{
61
+ $ this ->skipIfRedisUnavailable ();
62
+
57
63
try {
58
64
$ this ->doTestCachePools (['root_config ' => 'redis_custom_config.yml ' , 'environment ' => 'custom_redis_cache ' ], RedisAdapter::class);
59
65
} catch (\PHPUnit \Framework \Error \Warning $ e ) {
@@ -121,4 +127,13 @@ protected static function createKernel(array $options = []): KernelInterface
121
127
{
122
128
return parent ::createKernel (['test_case ' => 'CachePools ' ] + $ options );
123
129
}
130
+
131
+ private function skipIfRedisUnavailable ()
132
+ {
133
+ try {
134
+ (new \Redis ())->connect (getenv ('REDIS_HOST ' ));
135
+ } catch (\Exception $ e ) {
136
+ self ::markTestSkipped ($ e ->getMessage ());
137
+ }
138
+ }
124
139
}
You can’t perform that action at this time.
0 commit comments