Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Common FeatureContext classes for Behat
PHP
branch: mink_subcontext

This branch is 61 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Behat/CommonContexts
.gitignore
README.md
composer.json

README.md

Extra Contexts for Behat

This additional contexts could be used as your feature suite's submobules, giving you extra steps and hooks right out of the box.

How to Use Them

To use those contexts, you should simply instantiate them with needed arguments (see constructor arguments) and pass them into useContext() function like that:

<?php

namespace Acme\DemoBundle\Features\Context;

use Behat\BehatBundle\Context\BehatContext,
    Behat\BehatBundle\Context\MinkContext;
use Behat\Behat\Context\ClosuredContextInterface,
    Behat\Behat\Context\TranslatedContextInterface,
    Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
    Behat\Gherkin\Node\TableNode;

/**
 * Feature context.
 */
class FeatureContext extends MinkContext
{
    public function __construct($kernel)
    {
        $this->useContext('symfony_extra',
            new \Behat\CommonContexts\SymfonyExtraContext($kernel)
        );

        parent::__construct($kernel);
    }
}
Something went wrong with that request. Please try again.