-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reset message queues before scenario with zentruck/messenger-test
- Loading branch information
1 parent
1640b33
commit ab34cbb
Showing
5 changed files
with
81 additions
and
30 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Clear queues messages before scenario with zentruck | ||
|
||
## Installation | ||
|
||
1. Install the library: | ||
|
||
```bash | ||
composer require --dev zenstruck/messenger-test | ||
``` | ||
2. If not added automatically by Symfony Flex, add the bundle in `config/bundles.php`: | ||
|
||
```php | ||
Zenstruck\Messenger\Test\ZenstruckMessengerTestBundle::class => ['test' => true], | ||
``` | ||
|
||
3. Update `config/packages/messenger.yaml` and override your transport(s) | ||
in your `test` environment with `test://`: | ||
|
||
```yaml | ||
# config/packages/messenger.yaml | ||
# ... | ||
when@test: | ||
framework: | ||
messenger: | ||
transports: | ||
async: test:// | ||
``` | ||
|
||
## Transport | ||
|
||
You can interact with the test transports in your tests by using the | ||
`InteractsWithMessenger` trait in your `KernelTestCase`/`WebTestCase` tests. | ||
You can assert the different steps of message processing by asserting on the queue | ||
and the different states of message processing like "acknowledged", "rejected" and so on. | ||
|
||
> **Note**: If you only need to know if a message has been dispatched you can | ||
> make assertions [on the bus itself](#bus). | ||
|
||
More details you can see in [origin package repository](https://github.com/zenstruck/messenger-test) | ||
|
||
Zentruck will be used automatically after installation. |
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
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
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