Provides Behat BDD support for your Symfony2 project. See Behat official site for more info.
- Support latest Symfony2 release (PR3)
- Fully integrates with Symfony2 project
- Fully tested with Behat itself
- Covers basic functional testing needs
- Beautifull bundle testing possibilities
git submodule add git://github.com/everzet/EverzetBehatBundle.git src/Bundle/Everzet/BehatBundle
Behat depends on Symfony Translation Component, that comes after PR3 release. So, download latest Symfony2 version from
GitHub and copy src/Symfony/Component/Translation
directory inside your local src/vendor/symfony/src/Symfony/Component/
.
git submodule add git://github.com/everzet/Behat src/vendor/Behat
// src/autoload.php
$loader->registerNamespaces(array(
// ...
'Everzet\\Behat' => $vendorDir . '/Behat/src',
// ...
));
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Bundle\Everzet\BehatBundle\EverzetBehatBundle(),
// ...
);
}
# app/config/config.yml
behat.config: ~
EverzetBehatBundle have configuration alias:
behat.config
is core configurator of BehatBundle. Specify default formatter parameters and output options here.
For example, by default Behat uses pretty formatter. If you want to always use progress formatter instead of
specifying -f ...
option everytime, add this to your config:
# app/config/config.yml
behat.config:
formatter: progress
Other options is locale
and colors
Put your features inside your Bundle/Tests/Features/
directory, steps inside Bundle/Tests/Features/steps
, hooks and
env.php inside Bundle/Tests/Features/support
.
EverzetBehatBundle comes bundled with core steps. Look at them inside Bundle's BehatBundle/Resources/features
folder. Also,
you can view how to use them by looking at BehatBundle/Tests/Features/*
core BehatBundle tests.
EverzetBehatBundle provides some very useful CLI commands for running your features.
This command runs all features inside single bundle:
php app/console behat:test:bundle Application\\HelloBundle
to run HelloBundle application tests.
This command runs single specified feature:
php app/console behat:test:feature src/Application/HelloBundle/Tests/Features/SingleFeature.feature
EverzetBehatBundle supports all options, that Behat itself supports, including:
--formatter
or-f
: switch formatter (default ones is progress & pretty)--no-colors
: turn-off colors in formatter--i18n ...
: output formatter locale--tags ...
: filter features/scenarios by tag
List of developers who contributed:
- Konstantin Kudryashov (ever.zet@gmail.com)