Bu örnek mümkün olduğunca sade tutuldu ama siz istediğiniz gibi değiştirebilirsiniz.


Composer.json


"require-dev": {
"behat/behat": "2.5.5",
"behat/mink-extension": "1.3.3",
"behat/mink": "1.5.0",
"behat/symfony2-extension": "1.1.2",
"behat/mink-selenium2-driver": "1.1.1",
"behat/mink-browserkit-driver": "1.1.0",
"behat/mink-goutte-driver": "1.0.9",
"guzzle/guzzle": "3.9.2"
}

Behat.yml


default:
formatter:
name: pretty
parameters:
output_styles:
comment: [ magenta ]
context:
class: Application\BackendBundle\Features\Context\FeatureContext
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
kernel:
env: test
debug: true
Behat\MinkExtension\Extension:
base_url: 'http://football.local/app_test.php/'
javascript_session: symfony2
goutte: ~
selenium2: ~
paths:
features: %behat.paths.base%/src
bootstrap: %behat.paths.features%/Context

FeatureContext.php


namespace Application\BackendBundle\Features\Context;

use Behat\MinkExtension\Context\MinkContext;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

class FeatureContext extends MinkContext implements ContainerAwareInterface
{
private $container;

public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
}