2014-08-02 08:30:27 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\BehatExtension;
|
|
|
|
|
|
|
|
use Behat\MinkExtension\ServiceContainer\MinkExtension as BaseMinkExtension;
|
|
|
|
use SilverStripe\BehatExtension\Compiler\MinkExtensionBaseUrlPass;
|
2017-09-08 04:49:50 +02:00
|
|
|
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
|
|
|
|
{
|
2017-09-08 04:49:50 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|