silverstripe-behat-extension/src/MinkExtension.php

31 lines
966 B
PHP
Raw Permalink Normal View History

2014-08-02 08:30:27 +02:00
<?php
namespace SilverStripe\BehatExtension;
use Behat\MinkExtension\ServiceContainer\MinkExtension as BaseMinkExtension;
use SilverStripe\BehatExtension\Compiler\MinkExtensionBaseUrlPass;
use SilverStripe\MinkFacebookWebDriver\FacebookFactory;
2014-08-02 08:30:27 +02:00
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Subclass the main extension in order to get a say in the config compilation.
* We need to intercept setting the base_url to auto-detect it from SilverStripe configuration.
*
* Configured by adding `SilverStripe\BehatExtension\MinkExtension` to your behat.yml
*/
class MinkExtension extends BaseMinkExtension
{
public function __construct()
{
parent::__construct();
$this->registerDriverFactory(new FacebookFactory());
}
2014-08-02 08:30:27 +02:00
public function process(ContainerBuilder $container)
{
parent::process($container);
$urlPass = new MinkExtensionBaseUrlPass();
$urlPass->process($container);
}
}