Skip to content

Commit 46b8354

Browse files
alebedev80nicolas-grekas
authored andcommitted
[Cache] Fix connecting to Redis via a socket file
1 parent 369c4e8 commit 46b8354

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Tests/Functional/CachePoolsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected static function createKernel(array $options = []): KernelInterface
121121
private function skipIfRedisUnavailable()
122122
{
123123
try {
124-
(new \Redis())->connect(getenv('REDIS_HOST'));
124+
(new \Redis())->connect(...explode(':', getenv('REDIS_HOST')));
125125
} catch (\Exception $e) {
126126
self::markTestSkipped($e->getMessage());
127127
}

Tests/Functional/app/CachePools/redis_custom_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ services:
88
cache.test_redis_connection:
99
public: false
1010
class: Redis
11-
calls:
12-
- [connect, ['%env(REDIS_HOST)%']]
11+
factory: ['Symfony\Component\Cache\Adapter\RedisAdapter', 'createConnection']
12+
arguments: ['redis://%env(REDIS_HOST)%']
1313

1414
cache.app:
1515
parent: cache.adapter.redis

0 commit comments

Comments
 (0)