SymfonyExtension provides an integration with Mink and defines a dedicated, isolated driver to use for Symfony application testing.
- Require the packages needed for the driver using Composer:
composer require --dev behat/mink-extension behat/mink-browserkit-driver
- Enable the bundled driver:
# behat.yml.dist / behat.yml
default:
extensions:
# ...
Behat\MinkExtension:
sessions:
symfony:
symfony: ~
This integration provides two services to use inside Symfony container:
-
behat.mink
(autowired by\Behat\Mink\Mink
) - the Mink service -
behat.mink.default_session
(autowired by\Behat\Mink\Session
) - the default Mink session for the current scenario -
behat.mink.parameters
(autowired by\FriendsOfBehat\SymfonyExtension\Mink\MinkParameters
) - an object containing the configuration parameters ofMinkExtension
(implementing\ArrayAccess
so that it can be treated as an array)