Skip to content

Commit

Permalink
Add reset message queues before scenario with zentruck/messenger-test
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiidonii committed Nov 18, 2024
1 parent 5307f6d commit 4e57a79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/Context/TransportRetriever.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace BehatMessengerContext\Context;

use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Messenger\Transport\TransportInterface;
use Symfony\Contracts\Service\ServiceProviderInterface;

Expand Down
10 changes: 6 additions & 4 deletions tests/MessengerContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@

use Behat\Gherkin\Node\PyStringNode;
use BehatMessengerContext\Context\MessengerContext;
use BehatMessengerContext\Context\TransportRetriever;
use Exception;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Transport\InMemory\InMemoryTransport;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use BehatMessengerContext\Context\TransportRetriever;
use Exception;
use Symfony\Contracts\Service\ServiceProviderInterface;

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

$this->messengerContext->transportShouldContainMessageWithJson('invalid', new PyStringNode([json_encode([])], 1));
$this->messengerContext->transportShouldContainMessageWithJson(
'invalid',
new PyStringNode([json_encode([])], 1),
);
}

public function testAllTransportMessagesShouldBeJson(): void
Expand Down

0 comments on commit 4e57a79

Please sign in to comment.