8000 [Messenger][Redis] Fix auth option wrongly considered invalid · symfony/symfony@8bc6ee5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bc6ee5

Browse files
committed
[Messenger][Redis] Fix auth option wrongly considered invalid
1 parent 586899c commit 8bc6ee5

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpExtIntegrationTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,14 @@ public function testItSendsAndReceivesMessages()
7676
$this->assertEmpty(iterator_to_array($receiver->get()));
7777
}
7878

79-
/**
80-
* @group legacy
81-
* ^ for now, deprecation errors are thrown during serialization.
82-
*/
8379
public function testRetryAndDelay()
8480
{
85-
$serializer = $this->createSerializer();
86-
8781
$connection = Connection::fromDsn(getenv('MESSENGER_AMQP_DSN'));
8882
$connection->setup();
8983
$connection->purgeQueues();
9084

91-
$sender = new AmqpSender($connection, $serializer);
92-
$receiver = new AmqpReceiver($connection, $serializer);
85+
$sender = new AmqpSender($connection);
86+
$receiver = new AmqpReceiver($connection);
9387

9488
// send a first message
9589
$sender->send($first = new Envelope(new DummyMessage('First')));

src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php

Expand all lines: src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,6 @@ public function testAuthFromOptionsAndDsn()
191191
Connection::fromDsn('redis://password1@localhost/queue', ['auth' => 'password2'], $redis);
192192
}
193193

194-
public function testAuthAsUserInDsn()
195-
{
196-
$redis = $this->createMock(\Redis::class);
197-
198-
$redis->expects($this->exactly(1))->method('auth')
199-
->with('password')
200-
->willReturn(true);
201-
202-
Connection::fromDsn('redis://password:localhost/queue', [], $redis);
203-
}
204-
205194
public function testNoAuthWithEmptyPassword()
206195
{
207196
$redis = $this->createMock(\Redis::class);

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class Connection
4040
'redeliver_timeout' => 3600, // Timeout before redeliver messages still in pending state (seconds)
4141
'claim_interval' => 60000, // Interval by which pending/abandoned messages should be checked
4242
'lazy' => false,
43+
'auth' => null,
44+
'serializer' => \Redis::SERIALIZER_PHP,
4345
];
4446

4547
private $connection;
@@ -224,7 +226,6 @@ public static function fromDsn(string $dsn, array $redisOptions = [], \Redis $re
224226
private static function validateOptions(array $options): void
225227
{
226228
$availableOptions = array_keys(self::DEFAULT_OPTIONS);
227-
$availableOptions[] = 'serializer';
228229

229230
if (0 < \count($invalidOptions = array_diff(array_keys($options), $availableOptions))) {
230231
trigger_deprecation('symfony/messenger', '5.1', 'Invalid option(s) "%s" passed to the Redis Messenger transport. Passing invalid options is deprecated.', implode('", "', $invalidOptions));

0 commit comments

Comments
 (0)
0