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()
2626
2727 /**
2828 * @requires extension redis
29+ * @group integration
2930 */
3031 public function testRedisCachePools ()
3132 {
33+ $ this ->skipIfRedisUnavailable ();
34+
3235 try {
3336 $ this ->doTestCachePools (['root_config ' => 'redis_config.yml ' , 'environment ' => 'redis_cache ' ], RedisAdapter::class);
3437 } catch (\PHPUnit \Framework \Error \Warning $ e ) {
@@ -51,9 +54,12 @@ public function testRedisCachePools()
5154
5255 /**
5356 * @requires extension redis
57+ * @group integration
5458 */
5559 public function testRedisCustomCachePools ()
5660 {
61+ $ this ->skipIfRedisUnavailable ();
62+
5763 try {
5864 $ this ->doTestCachePools (['root_config ' => 'redis_custom_config.yml ' , 'environment ' => 'custom_redis_cache ' ], RedisAdapter::class);
5965 } catch (\PHPUnit \Framework \Error \Warning $ e ) {
@@ -121,4 +127,13 @@ protected static function createKernel(array $options = []): KernelInterface
121127 {
122128 return parent ::createKernel (['test_case ' => 'CachePools ' ] + $ options );
123129 }
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+ }
124139}
You can’t perform that action at this time.
0 commit comments