8000 minor #59861 [Cache] Fix `PredisAdapter` tests (alexandre-daubois) · symfony/symfony@d134414 · GitHub
[go: up one dir, main page]

Skip to content

Commit d134414

Browse files
minor #59861 [Cache] Fix PredisAdapter tests (alexandre-daubois)
This PR was merged into the 6.4 branch. Discussion ---------- [Cache] Fix `PredisAdapter` tests | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Commits ------- 3686ba1 [Cache] Fix `PredisAdapter` tests
2 parents f4081a4 + 3686ba1 commit d134414

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

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

Lines changed: 16 additions & 2 deletions
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