Skip to content

Commit 952c4fa

Browse files
Merge branch '4.4' into 5.4
* 4.4: [Cache] Fix connecting to Redis via a socket file [DependencyInjection][FrameworkBundle] Fix using PHP 8.1 enum as parameters [PropertyAccessor] Add missing TypeError catch [FrameworkBundle] Fix log channel of TagAwareAdapter [HttpClient] Fix Content-Length header when possible [DependencyInjection] Don't dump polyfilled classes in preload script
2 parents a0cc3e6 + dd73e8f commit 952c4fa

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Tests/Store/CombinedStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function getClockDelay()
4343
*/
4444
public function getStore(): PersistingStoreInterface
4545
{
46-
$redis = new \Predis\Client('tcp://'.getenv('REDIS_HOST').':6379');
46+
$redis = new \Predis\Client(array_combine(['host', 'port'], explode(':', getenv('REDIS_HOST')) + [1 => null]));
4747
try {
4848
$redis->connect();
4949
} catch (\Exception $e) {

Tests/Store/PredisStoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class PredisStoreTest extends AbstractRedisStoreTest
2121
{
2222
public static function setUpBeforeClass(): void
2323
{
24-
$redis = new \Predis\Client('tcp://'.getenv('REDIS_HOST').':6379');
24+
$redis = new \Predis\Client(array_combine(['host', 'port'], explode(':', getenv('REDIS_HOST')) + [1 => null]));
2525
try {
2626
$redis->connect();
2727
} catch (\Exception $e) {
@@ -34,7 +34,7 @@ public static function setUpBeforeClass(): void
3434
*/
3535
protected function getRedisConnection(): object
3636
{
37-
$redis = new \Predis\Client('tcp://'.getenv('REDIS_HOST').':6379');
37+
$redis = new \Predis\Client(array_combine(['host', 'port'], explode(':', getenv('REDIS_HOST')) + [1 => null]));
3838
$redis->connect();
3939

4040
return $redis;

Tests/Store/RedisArrayStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function setUpBeforeClass(): void
2727
throw new SkippedTestSuiteError('The RedisArray class is required.');
2828
}
2929
try {
30-
(new \Redis())->connect(getenv('REDIS_HOST'));
30+
(new \Redis())->connect(...explode(':', getenv('REDIS_HOST')));
3131
} catch (\Exception $e) {
3232
throw new SkippedTestSuiteError($e->getMessage());
3333
}

Tests/Store/RedisStoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class RedisStoreTest extends AbstractRedisStoreTest
2828
public static function setUpBeforeClass(): void
2929
{
3030
try {
31-
(new \Redis())->connect(getenv('REDIS_HOST'));
31+
(new \Redis())->connect(...explode(':', getenv('REDIS_HOST')));
3232
} catch (\Exception $e) {
3333
throw new SkippedTestSuiteError($e->getMessage());
3434
}
@@ -40,7 +40,7 @@ public static function setUpBeforeClass(): void
4040
protected function getRedisConnection(): object
4141
{
4242
$redis = new \Redis();
43-
$redis->connect(getenv('REDIS_HOST'));
43+
$redis->connect(...explode(':', getenv('REDIS_HOST')));
4444

4545
return $redis;
4646
}

Tests/Store/RetryTillSaveStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RetryTillSaveStoreTest extends AbstractStoreTest
2626

2727
public function getStore(): PersistingStoreInterface
2828
{
29-
$redis = new \Predis\Client('tcp://'.getenv('REDIS_HOST').':6379');
29+
$redis = new \Predis\Client(array_combine(['host', 'port'], explode(':', getenv('REDIS_HOST')) + [1 => null]));
3030
try {
3131
$redis->connect();
3232
} catch (\Exception $e) {

0 commit comments

Comments
 (0)