for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Behat\Symfony2Extension\Factory;
use Behat\Mink\Driver\BrowserKitDriver;
use Behat\MinkExtension\ServiceContainer\Driver\DriverFactory;
use Behat\Symfony2Extension\Driver\KernelDriver;
use Sylius\Behat\Symfony2Extension\ServiceContainer\Symfony2Extension;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
/**
* @author Arkadiusz Krakowiak <[email protected]>
final class IsolatedSymfonyFactory implements DriverFactory
{
* {@inheritdoc}
public function getDriverName()
return 'symfony2';
}
public function supportsJavascript()
return false;
public function configure(ArrayNodeDefinition $builder)
public function buildDriver(array $config)
$this->assertMinkBrowserKitDriverIsAvailable();
return new Definition(KernelDriver::class, [
new Reference(Symfony2Extension::DRIVER_KERNEL_ID),
'%mink.base_url%',
]);
* @throws \RuntimeException If MinkBrowserKitDriver is not available
private function assertMinkBrowserKitDriverIsAvailable()
if (!class_exists(BrowserKitDriver::class)) {
throw new \RuntimeException('Install MinkBrowserKitDriver in order to use the symfony2 driver.');