Last active
December 17, 2022 19:52
-
-
Save dgafka/585b96fa7c04d54aa25b58967fefd39b to your computer and use it in GitHub Desktop.
testing-message-driven-architecture-in-php-07.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ecotoneTestSupport = EcotoneLite::bootstrapForTesting( | |
[OrderService::class, OrderNotifier::class], | |
$dependencyContainer, | |
ServiceConfiguration::createWithDefaults() | |
// We disable asynchronous module, so our asynchronous code becomes synchronous | |
->withSkippedModulePackageNames([ModulePackageList::ASYNCHRONOUS_PACKAGE]), | |
); | |
$ecotoneTestSupport->getCommandBus()->send(PlaceOrder::create($orderId)); | |
// This means we don't need to run our consumer anymore, because Event Handler is triggered synchronously. | |
Assert::assertEquals(1, $ecotoneTestSupport->sendQueryWithRouting("notificationService.getSentNotificationsCount")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment