8000 Merge branch '7.2' into 7.3 · symfony/symfony@c0c0a8f · GitHub
[go: up one dir, main page]

Skip to content

Commit c0c0a8f

Browse files
Merge branch '7.2' into 7.3
* 7.2: [Cache] Fix `PredisAdapter` tests
2 parents 946883f + 770120c commit c0c0a8f

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/Symfony/Component/Cache/Tests/Adapter/PredisAdapterTest.php

+16-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public function testCreateConnection()
3636
$this->assertInstanceOf(StreamConnection::class, $connection);
3737

3838
$redisHost = explode(':', $redisHost);
39+
$connectionParameters = $connection->getParameters()->toArray();
40+
3941
$params = [
4042
'scheme' => 'tcp',
4143
'host' => $redisHost[0],
@@ -46,7 +48,12 @@ public function testCreateConnection()
4648
'tcp_nodelay' => true,
4749
'database' => '1',
4850
];
49-
$this->assertSame($params, $connection->getParameters()->toArray());
51+
52+
if (isset($connectionParameters['conn_uid'])) {
53+
$params['conn_uid'] = $connectionParameters['conn_uid']; // if present, the value cannot be predicted
54+
}
55+
56+
$this->assertSame($params, $connectionParameters);
5057
}
5158

5259
public function testCreateSslConnection()
@@ -60,6 +67,8 @@ public function testCreateSslConnection()
6067
$this->assertInstanceOf(StreamConnection::class, $connection);
6168

6269
$redisHost = explode(':', $redisHost);
70+
$connectionParameters = $connection->getParameters()->toArray();
71+
6372
$params = [
6473
'scheme' => 'tls',
6574
'host' => $redisHost[0],
@@ -71,7 +80,12 @@ public function testCreateSslConnection()
7180
'tcp_nodelay' => true,
7281
'database' => '1',
7382
];
74-
$this->assertSame($params, $connection->getParameters()->toArray());
83+
84+
if (isset($connectionParameters['conn_uid'])) {
85+
$params['conn_uid'] = $connectionParameters['conn_uid']; // if present, the value cannot be predicted
86+
}
87+
88+
$this->assertSame($params, $connectionParameters);
7589
}
7690

7791
public function testAclUserPasswordAuth()

0 commit comments

Comments
 (0)
0