Merge pull request #116 from digitalkaoz/2.0_behat_3_fixes
made compatible with behat 3rc1
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
"require": {
|
||||
"php": ">=5.3.2",
|
||||
"behat/behat": "~3@dev",
|
||||
"behat/behat": "~3.0-RC1@dev",
|
||||
"behat/mink": ">=1.4.3,<1.6-dev",
|
||||
"symfony/config": "~2.2"
|
||||
},
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
namespace Behat\MinkExtension\Context\Initializer;
|
||||
|
||||
use Behat\Behat\Context\Initializer\InitializerInterface,
|
||||
Behat\Behat\Context\ContextInterface;
|
||||
use Behat\Behat\Context\Context;
|
||||
use Behat\Behat\Context\Initializer\ContextInitializer;
|
||||
|
||||
use Behat\Mink\Mink;
|
||||
|
||||
use Behat\MinkExtension\Context\MinkAwareInterface;
|
||||
|
||||
/*
|
||||
@@ -23,7 +22,7 @@ use Behat\MinkExtension\Context\MinkAwareInterface;
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*/
|
||||
class MinkAwareInitializer implements InitializerInterface
|
||||
class MinkAwareInitializer implements ContextInitializer
|
||||
{
|
||||
private $mink;
|
||||
private $parameters;
|
||||
@@ -43,11 +42,11 @@ class MinkAwareInitializer implements InitializerInterface
|
||||
/**
|
||||
* Checks if initializer supports provided context.
|
||||
*
|
||||
* @param ContextInterface $context
|
||||
* @param Context $context
|
||||
*
|
||||
* @return Boolean
|
||||
*/
|
||||
public function supports(ContextInterface $context)
|
||||
public function supportsContext(Context $context)
|
||||
{
|
||||
// if context/subcontext implements MinkAwareInterface
|
||||
if ($context instanceof MinkAwareInterface) {
|
||||
@@ -68,9 +67,9 @@ class MinkAwareInitializer implements InitializerInterface
|
||||
/**
|
||||
* Initializes provided context.
|
||||
*
|
||||
* @param ContextInterface $context
|
||||
* @param Context $context
|
||||
*/
|
||||
public function initialize(ContextInterface $context)
|
||||
public function initializeContext(Context $context)
|
||||
{
|
||||
$context->setMink($this->mink);
|
||||
$context->setMinkParameters($this->parameters);
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
|
||||
namespace Behat\MinkExtension\Context;
|
||||
|
||||
use Behat\Behat\Context\TranslatableContext;
|
||||
use Behat\Gherkin\Node\TableNode;
|
||||
|
||||
use Behat\Behat\Context\TranslatableContextInterface,
|
||||
Behat\Behat\Event\ScenarioEvent;
|
||||
|
||||
/*
|
||||
* This file is part of the Behat\MinkExtension.
|
||||
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
@@ -21,7 +19,7 @@ use Behat\Behat\Context\TranslatableContextInterface,
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*/
|
||||
class MinkContext extends RawMinkContext implements TranslatableContextInterface
|
||||
class MinkContext extends RawMinkContext implements TranslatableContext
|
||||
{
|
||||
/**
|
||||
* Opens homepage.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Behat\MinkExtension\Context;
|
||||
|
||||
use Behat\Behat\Context\ContextInterface;
|
||||
use Behat\Behat\Context\Context;
|
||||
|
||||
use Behat\Mink\Mink,
|
||||
Behat\Mink\WebAssert,
|
||||
@@ -22,7 +22,7 @@ use Behat\Mink\Mink,
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*/
|
||||
class RawMinkContext implements MinkAwareInterface, ContextInterface
|
||||
class RawMinkContext implements MinkAwareInterface, Context
|
||||
{
|
||||
private $mink;
|
||||
private $minkParameters;
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace Behat\MinkExtension;
|
||||
|
||||
use Behat\MinkExtension\Compiler\SelectorsPass;
|
||||
use Behat\MinkExtension\Compiler\SessionsPass;
|
||||
use Symfony\Component\Config\FileLocator,
|
||||
Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition,
|
||||
Symfony\Component\DependencyInjection\ContainerBuilder,
|
||||
Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
||||
|
||||
use Behat\Behat\Extension\ExtensionInterface;
|
||||
use Behat\Testwork\ServiceContainer\Extension as BaseExtension;
|
||||
|
||||
/*
|
||||
* This file is part of the Behat\MinkExtension
|
||||
@@ -23,15 +25,12 @@ use Behat\Behat\Extension\ExtensionInterface;
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*/
|
||||
class Extension implements ExtensionInterface
|
||||
class Extension implements BaseExtension
|
||||
{
|
||||
/**
|
||||
* Loads a specific configuration.
|
||||
*
|
||||
* @param array $config Extension configuration hash (from behat.yml)
|
||||
* @param ContainerBuilder $container ContainerBuilder instance
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function load(array $config, ContainerBuilder $container)
|
||||
public function load(ContainerBuilder $container, array $config)
|
||||
{
|
||||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/services'));
|
||||
$loader->load('core.xml');
|
||||
@@ -159,11 +158,9 @@ class Extension implements ExtensionInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Setups configuration for current extension.
|
||||
*
|
||||
* @param ArrayNodeDefinition $builder
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getConfig(ArrayNodeDefinition $builder)
|
||||
public function configure(ArrayNodeDefinition $builder)
|
||||
{
|
||||
$config = $this->loadEnvironmentConfiguration();
|
||||
|
||||
@@ -406,16 +403,23 @@ class Extension implements ExtensionInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns compiler passes used by mink extension.
|
||||
*
|
||||
* @return array
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getCompilerPasses()
|
||||
public function getConfigKey()
|
||||
{
|
||||
return array(
|
||||
new Compiler\SelectorsPass(),
|
||||
new Compiler\SessionsPass(),
|
||||
);
|
||||
return 'mink';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
$sessionsPass = new SessionsPass();
|
||||
$selectorPass = new SelectorsPass();
|
||||
|
||||
$sessionsPass->process($container);
|
||||
$selectorPass->process($container);
|
||||
}
|
||||
|
||||
protected function loadEnvironmentConfiguration()
|
||||
@@ -428,8 +432,4 @@ class Extension implements ExtensionInterface
|
||||
return $config;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'mink';
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@
|
||||
<service id="behat.mink.context.initializer" class="%behat.mink.context.initializer.class%">
|
||||
<argument type="service" id="behat.mink" />
|
||||
<argument>%behat.mink.parameters%</argument>
|
||||
<tag name="context.initializer" />
|
||||
<tag name="context.initializer" priority="0" />
|
||||
</service>
|
||||
|
||||
<service id="behat.mink.listener.sessions_listener" class="%behat.mink.listener.sessions_listener.class%">
|
||||
|
||||
Reference in New Issue
Block a user