macpaw / behat-messenger-context
Behat Context for testing Symfony Messenger component
Installs: 69 291
Dependents: 0
Suggesters: 0
Security: 0
Stars: 15
Watchers: 8
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.2
- behat/behat: ^3.0
- macpaw/similar-arrays: ^1.0
- symfony/dependency-injection: ^6.3 || ^7.0
- symfony/http-kernel: ^6.3 || ^7.0
- symfony/messenger: ^6.3 || ^7.0
- symfony/serializer: ^6.3 || ^7.0
Requires (Dev)
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.3
- slevomat/coding-standard: ^7.0
- squizlabs/php_codesniffer: ^3.6
README
Version | Build Status | Code Coverage |
---|---|---|
master |
||
develop |
Installation
Step 1: Download the Bundle
Open a command console, enter your project directory and execute:
Applications that use Symfony Flex in progress
$ composer require --dev macpaw/behat-messenger-context
Applications that don't use Symfony Flex
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require --dev macpaw/behat-messenger-context
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... BehatMessengerContext\BehatMessengerContextBundle::class => ['test' => true], ); // ... } // ... }
Step 2: Configure Messenger
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.
framework: messenger: transports: async: 'in-memory://' async_priority_high: 'in-memory://' ... ...
Step 3: Configure Behat
Go to behat.yml
... contexts: - BehatMessengerContext\Context\MessengerContext ...