|
12 | 12 | namespace Symfony\Component\Messenger\Bridge\Amqp\Tests\Transport;
|
13 | 13 |
|
14 | 14 | use PHPUnit\Framework\TestCase;
|
| 15 | +use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; |
15 | 16 | use Symfony\Component\Messenger\Bridge\Amqp\Tests\Fixtures\DummyMessage;
|
16 | 17 | use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpFactory;
|
17 | 18 | use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpStamp;
|
|
23 | 24 | */
|
24 | 25 | class ConnectionTest extends TestCase
|
25 | 26 | {
|
| 27 | + use ExpectDeprecationTrait; |
| 28 | + |
26 | 29 | private const DEFAULT_EXCHANGE_NAME = 'messages';
|
27 | 30 |
|
28 | 31 | public function testItCannotBeConstructedWithAWrongDsn()
|
@@ -104,37 +107,37 @@ public function testOptionsAreTakenIntoAccountAndOverwrittenByDsn()
|
104 | 107 |
|
105 | 108 | /**
|
106 | 109 | * @group legacy
|
107 |
| - * @expectedDeprecation Since symfony/messenger 5.1: Invalid option(s) "foo" passed to the AMQP Messenger transport. Passing invalid options is deprecated. |
108 | 110 | */
|
109 | 111 | public function testDeprecationIfInvalidOptionIsPassedWithDsn()
|
110 | 112 | {
|
| 113 | + $this->expectDeprecation('Since symfony/messenger 5.1: Invalid option(s) "foo" passed to the AMQP Messenger transport. Passing invalid options is deprecated.'); |
111 | 114 | Connection::fromDsn('amqp://host?foo=bar');
|
112 | 115 | }
|
113 | 116 |
|
114 | 117 | /**
|
115 | 118 | * @group legacy
|
116 |
| - * @expectedDeprecation Since symfony/messenger 5.1: Invalid option(s) "foo" passed to the AMQP Messenger transport. Passing invalid options is deprecated. |
117 | 119 | */
|
118 | 120 | public function testDeprecationIfInvalidOptionIsPassedAsArgument()
|
119 | 121 | {
|
| 122 | + $this->expectDeprecation('Since symfony/messenger 5.1: Invalid option(s) "foo" passed to the AMQP Messenger transport. Passing invalid options is deprecated.'); |
120 | 123 | Connection::fromDsn('amqp://host', ['foo' => 'bar']);
|
121 | 124 | }
|
122 | 125 |
|
123 | 126 | /**
|
124 | 127 | * @group legacy
|
125 |
| - * @expectedDeprecation Since symfony/messenger 5.1: Invalid queue option(s) "foo" passed to the AMQP Messenger transport. Passing invalid queue options is deprecated. |
126 | 128 | */
|
127 | 129 | public function testDeprecationIfInvalidQueueOptionIsPassed()
|
128 | 130 | {
|
| 131 | + $this->expectDeprecation('Since symfony/messenger 5.1: Invalid queue option(s) "foo" passed to the AMQP Messenger transport. Passing invalid queue options is deprecated.'); |
129 | 132 | Connection::fromDsn('amqp://host', ['queues' => ['queueName' => ['foo' => 'bar']]]);
|
130 | 133 | }
|
131 | 134 |
|
132 | 135 | /**
|
133 | 136 | * @group legacy
|
134 |
| - * @expectedDeprecation Since symfony/messenger 5.1: Invalid exchange option(s) "foo" passed to the AMQP Messenger transport. Passing invalid exchange options is deprecated. |
135 | 137 | */
|
136 | 138 | public function testDeprecationIfInvalidExchangeOptionIsPassed()
|
137 | 139 | {
|
| 140 | + $this->expectDeprecation('Since symfony/messenger 5.1: Invalid exchange option(s) "foo" passed to the AMQP Messenger transport. Passing invalid exchange options is deprecated.'); |
138 | 141 | Connection::fromDsn('amqp://host', ['exchange' => ['foo' => 'bar']]);
|
139 | 142 | }
|
140 | 143 |
|
|
0 commit comments