10000 Fixing missed tests from #31355 · symfony/symfony@ab37449 · GitHub
[go: up one dir, main page]

Skip to content

Commit ab37449

Browse files
committed
Fixing missed tests from #31355
1 parent b2f5b8a commit ab37449

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private function assertApproximateDuration($startTime, int $expectedDuration)
227227
$actualDuration = microtime(true) - $startTime;
228228

229229
if (\method_exists([$this, 'assertEqualsWithDelta'])) {
230-
$this->assertEqualsWithDelta($expectedDuration, $actualDuration, 'Duration was not within expected range', .5);
230+
$this->assertEqualsWithDelta($expectedDuration, $actualDuration, .5, 'Duration was not within expected range');
231231
} else {
232232
$this->assertEquals($expectedDuration, $actualDuration, 'Duration was not within expected range', .5);
233233
}

src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/ConnectionTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,16 @@ public function testItDelaysTheMessage()
326326
$delayExchange->expects($this->once())->method('declareExchange');
327327
$delayExchange->method('getName')->willReturn('delay');
328328

329-
$delayQueue->expects($this->once())->method('setName')->with('delay_queue_5000');
329+
$delayQueue->expects($this->once())->method('setName')->with('delay_queue__5000');
330330
$delayQueue->expects($this->once())->method('setArguments')->with([
331331
'x-message-ttl' => 5000,
332332
'x-dead-letter-exchange' => 'messages',
333333
]);
334334

335335
$delayQueue->expects($this->once())->method('declareQueue');
336-
$delayQueue->expects($this->once())->method('bind')->with('delay', 'delay_5000');
336+
$delayQueue->expects($this->once())->method('bind')->with('delay', 'delay__5000');
337337

338-
$delayExchange->expects($this->once())->method('publish')->with('{}', 'delay_5000', AMQP_NOPARAM, ['headers' => ['x-some-headers' => 'foo']]);
338+
$delayExchange->expects($this->once())->method('publish')->with('{}', 'delay__5000', AMQP_NOPARAM, ['headers' => ['x-some-headers' => 'foo']]);
339339

340340
$connection = Connection::fromDsn('amqp://localhost/%2f/messages', [], $factory);
341341
$connection->publish('{}', ['x-some-headers' => 'foo'], 5000);
@@ -371,22 +371,22 @@ public function testItDelaysTheMessageWithADifferentRoutingKeyAndTTLs()
371371

372372
$connection = Connection::fromDsn('amqp://localhost/%2f/messages', $connectionOptions, $factory);
373373

374-
$delayQueue->expects($this->once())->method('setName')->with('delay_queue_120000');
374+
$delayQueue->expects($this->once())->method('setName')->with('delay_queue__120000');
375375
$delayQueue->expects($this->once())->method('setArguments')->with([
376376
'x-message-ttl' => 120000,
377377
'x-dead-letter-exchange' => 'messages',
378378
]);
379379

380380
$delayQueue->expects($this->once())->method('declareQueue');
381-
$delayQueue->expects($this->once())->method('bind')->with('delay', 'delay_120000');
381+
$delayQueue->expects($this->once())->method('bind')->with('delay', 'delay__120000');
382382

383-
$delayExchange->expects($this->once())->method('publish')->with('{}', 'delay_120000', AMQP_NOPARAM, ['headers' => []]);
383+
$delayExchange->expects($this->once())->method('publish')->with('{}', 'delay__120000', AMQP_NOPARAM, ['headers' => []]);
384384
$connection->publish('{}', [], 120000);
385385
}
386386

387387
/**
388388
* @expectedException \AMQPException
389-
* @expectedExceptionMessage Could not connect to the AMQP server. Please verify the provided DSN. ({"delay":{"routing_key_pattern":"delay_%delay%","exchange_name":"delay","queue_name_pattern":"delay_queue_%delay%"},"host":"localhost","port":5672,"vhost":"\/","login":"user","password":"********"})
389+
* @expectedExceptionMessage Could not connect to the AMQP server. Please verify the provided DSN. ({"delay":{"routing_key_pattern":"delay_%routing_key%_%delay%","exchange_name":"delay","queue_name_pattern":"delay_queue_%routing_key%_%delay%"},"host":"localhost","port":5672,"vhost":"\/","login":"user","password":"********"})
390390
*/
391391
public function testObfuscatePasswordInDsn()
392392
{
@@ -465,7 +465,7 @@ public function testItDelaysTheMessageWithTheInitialSuppliedRoutingKeyAsArgument
465465

466466
$connection = Connection::fromDsn('amqp://localhost/%2f/messages', $connectionOptions, $factory);
467467

468-
$delayQueue->expects($this->once())->method('setName')->with('delay_queue_120000');
468+
$delayQueue->expects($this->once())->method('setName')->with('delay_queue_routing_key_120000');
469469
$delayQueue->expects($this->once())->method('setArguments')->with([
470470
'x-message-ttl' => 120000,
471471
'x-dead-letter-exchange' => 'messages',
@@ -476,9 +476,9 @@ public function testItDelaysTheMessageWithTheInitialSuppliedRoutingKeyAsArgument
476476
);
477477

478478
$delayQueue->expects($this->once())->method('declareQueue');
479-
$delayQueue->expects($this->once())->method('bind')->with('delay', 'delay_120000');
479+
$delayQueue->expects($this->once())->method('bind')->with('delay', 'delay_routing_key_120000');
480480

481-
$delayExchange->expects($this->once())->method('publish')->with('{}', 'delay_120000', AMQP_NOPARAM, ['headers' => []]);
481+
$delayExchange->expects($this->once())->method('publish')->with('{}', 'delay_routing_key_120000', AMQP_NOPARAM, ['headers' => []]);
482482
$connection->publish('{}', [], 120000, new AmqpStamp('routing_key'));
483483
}
484484

0 commit comments

Comments
 (0)
0