Skip to content

Commit 24382bb

Browse files
hkdobrevfabpot
authored andcommitted
[PhpUnitBridge] Deprecate @expectedDeprecation annotation
1 parent 33d437b commit 24382bb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Tests/Transport/ConnectionTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Messenger\Bridge\Amqp\Tests\Transport;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1516
use Symfony\Component\Messenger\Bridge\Amqp\Tests\Fixtures\DummyMessage;
1617
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpFactory;
1718
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpStamp;
@@ -23,6 +24,8 @@
2324
*/
2425
class ConnectionTest extends TestCase
2526
{
27+
use ExpectDeprecationTrait;
28+
2629
private const DEFAULT_EXCHANGE_NAME = 'messages';
2730

2831
public function testItCannotBeConstructedWithAWrongDsn()
@@ -104,37 +107,37 @@ public function testOptionsAreTakenIntoAccountAndOverwrittenByDsn()
104107

105108
/**
106109
* @group legacy
107-
* @expectedDeprecation Since symfony/messenger 5.1: Invalid option(s) "foo" passed to the AMQP Messenger transport. Passing invalid options is deprecated.
108110
*/
109111
public function testDeprecationIfInvalidOptionIsPassedWithDsn()
110112
{
113+
$this->expectDeprecation('Since symfony/messenger 5.1: Invalid option(s) "foo" passed to the AMQP Messenger transport. Passing invalid options is deprecated.');
111114
Connection::fromDsn('amqp://host?foo=bar');
112115
}
113116

114117
/**
115118
* @group legacy
116-
* @expectedDeprecation Since symfony/messenger 5.1: Invalid option(s) "foo" passed to the AMQP Messenger transport. Passing invalid options is deprecated.
117119
*/
118120
public function testDeprecationIfInvalidOptionIsPassedAsArgument()
119121
{
122+
$this->expectDeprecation('Since symfony/messenger 5.1: Invalid option(s) "foo" passed to the AMQP Messenger transport. Passing invalid options is deprecated.');
120123
Connection::fromDsn('amqp://host', ['foo' => 'bar']);
121124
}
122125

123126
/**
124127
* @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.
126128
*/
127129
public function testDeprecationIfInvalidQueueOptionIsPassed()
128130
{
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.');
129132
Connection::fromDsn('amqp://host', ['queues' => ['queueName' => ['foo' => 'bar']]]);
130133
}
131134

132135
/**
133136
* @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.
135137
*/
136138
public function testDeprecationIfInvalidExchangeOptionIsPassed()
137139
{
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.');
138141
Connection::fromDsn('amqp://host', ['exchange' => ['foo' => 'bar']]);
139142
}
140143

0 commit comments

Comments
 (0)