Skip to content

Commit 4e57a79

Browse files
committed
Add reset message queues before scenario with zentruck/messenger-test
1 parent 5307f6d commit 4e57a79

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Context/TransportRetriever.php

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace BehatMessengerContext\Context;
66

7-
use Symfony\Component\DependencyInjection\Container;
8-
use Symfony\Component\DependencyInjection\ContainerInterface;
97
use Symfony\Component\Messenger\Transport\TransportInterface;
108
use Symfony\Contracts\Service\ServiceProviderInterface;
119

tests/MessengerContextTest.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66

77
use Behat\Gherkin\Node\PyStringNode;
88
use BehatMessengerContext\Context\MessengerContext;
9+
use BehatMessengerContext\Context\TransportRetriever;
10+
use Exception;
911
use PHPUnit\Framework\MockObject\MockObject;
1012
use PHPUnit\Framework\TestCase;
1113
use Symfony\Component\DependencyInjection\Container;
1214
use Symfony\Component\DependencyInjection\ContainerInterface;
1315
use Symfony\Component\Messenger\Envelope;
1416
use Symfony\Component\Messenger\Transport\InMemory\InMemoryTransport;
1517
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
16-
use BehatMessengerContext\Context\TransportRetriever;
17-
use Exception;
18-
use Symfony\Contracts\Service\ServiceProviderInterface;
1918

2019
class MessengerContextTest extends TestCase
2120
{
@@ -277,7 +276,10 @@ public function testTransportNotFoundThrowsException(): void
277276
$this->expectException(Exception::class);
278277
$this->expectExceptionMessage('Transport messenger.transport.invalid not found');
279278

280-
$this->messengerContext->transportShouldContainMessageWithJson('invalid', new PyStringNode([json_encode([])], 1));
279+
$this->messengerContext->transportShouldContainMessageWithJson(
280+
'invalid',
281+
new PyStringNode([json_encode([])], 1),
282+
);
281283
}
282284

283285
public function testAllTransportMessagesShouldBeJson(): void

0 commit comments

Comments
 (0)