|
1 |
| -# Messenger Behat Context |
| 1 | +Behat Messenger Context |
| 2 | +================================= |
| 3 | + |
| 4 | +| Version | Build Status | Code Coverage | |
| 5 | +|:---------:|:-------------:|:-----:| |
| 6 | +| `master`| [![CI][master Build Status Image]][master Build Status] | [![Coverage Status][master Code Coverage Image]][master Code Coverage] | |
| 7 | +| `develop`| [![CI][develop Build Status Image]][develop Build Status] | [![Coverage Status][develop Code Coverage Image]][develop Code Coverage] | |
| 8 | + |
| 9 | +Installation |
| 10 | +============ |
| 11 | + |
| 12 | +Step 1: Install Context |
| 13 | +---------------------------------- |
| 14 | +Open a command console, enter your project directory and execute: |
| 15 | + |
| 16 | +```console |
| 17 | +$ composer require --dev macpaw/behat-messenger-context |
| 18 | +``` |
| 19 | + |
| 20 | +Step 2: Update Container config to load Messenger Context |
| 21 | +---------------------------------- |
| 22 | +In the `config/services_test.yaml` file of your project: |
2 | 23 |
|
3 |
| -### Install |
4 |
| -```shell script |
5 |
| -composer require macpaw/messenger-behat-context |
6 | 24 | ```
|
| 25 | + BehatMessengerContext\: |
| 26 | + resource: '../vendor/macpaw/behat-messenger-context/src/*' |
| 27 | + arguments: |
| 28 | + - '@test.service_container' |
| 29 | +``` |
| 30 | + |
| 31 | +Step 3: Configure Messenger |
| 32 | +============= |
| 33 | +Copying `config/packages/dev/messenger.yaml` and pasting that into `config/packages/test/`. This gives us messenger configuration that will only be used in the test environment. Uncomment the code, and replace sync with in-memory. Do that for both of the transports. |
| 34 | + |
| 35 | +```yaml |
| 36 | +framework: |
| 37 | + messenger: |
| 38 | + transports: |
| 39 | + async: 'in-memory://' |
| 40 | + async_priority_high: 'in-memory://' |
| 41 | + ... |
| 42 | +... |
| 43 | +``` |
| 44 | + |
| 45 | + |
| 46 | +Step 4: Configure Behat |
| 47 | +============= |
| 48 | +Go to `behat.yml` |
| 49 | + |
| 50 | +```yaml |
| 51 | +... |
| 52 | + contexts: |
| 53 | + - BehatMessengerContext\Context\MessengerContext |
| 54 | +... |
| 55 | +``` |
| 56 | + |
| 57 | +[master Build Status]: https://github.com/macpaw/BehatMessengerContext/actions?query=workflow%3ACI+branch%3Amaster |
| 58 | +[master Build Status Image]: https://github.com/macpaw/BehatMessengerContext/workflows/CI/badge.svg?branch=master |
| 59 | +[develop Build Status]: https://github.com/macpaw/BehatMessengerContext/actions?query=workflow%3ACI+branch%3Adevelop |
| 60 | +[develop Build Status Image]: https://github.com/macpaw/BehatMessengerContext/workflows/CI/badge.svg?branch=develop |
| 61 | +[master Code Coverage]: https://codecov.io/gh/macpaw/BehatMessengerContext/branch/master |
| 62 | +[master Code Coverage Image]: https://img.shields.io/codecov/c/github/macpaw/BehatMessengerContext/master?logo=codecov |
| 63 | +[develop Code Coverage]: https://codecov.io/gh/macpaw/BehatMessengerContext/branch/develop |
| 64 | +[develop Code Coverage Image]: https://img.shields.io/codecov/c/github/macpaw/BehatMessengerContext/develop?logo=codecov |
0 commit comments