Test Failed
Push — feature/extension ( 33c0b5 )
by Yo
03:23
created

Behat3SymfonyDriverFactory::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
namespace Yoanm\Behat3SymfonyExtension\ServiceContainer\Driver;
3
4
use Behat\MinkExtension\ServiceContainer\Driver\DriverFactory;
5
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
6
use Symfony\Component\DependencyInjection\Definition;
7
use Symfony\Component\DependencyInjection\Reference;
8
use Yoanm\Behat3SymfonyExtension\Driver\KernelDriver;
9
10
class Behat3SymfonyDriverFactory implements DriverFactory
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function getDriverName()
16
    {
17
        return 'behat3Symfony';
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function supportsJavascript()
24
    {
25
        return false;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function configure(ArrayNodeDefinition $builder)
32
    {
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function buildDriver(array $config)
39
    {
40
        if (!class_exists('Behat\Mink\Driver\BrowserKitDriver')) {
41
            throw new \RuntimeException(
42
                'Install MinkBrowserKitDriver in order to use the behat3Symfony driver.'
43
            );
44
        }
45
46
        return new Definition(
47
            KernelDriver::class,
48
            array(
49
                new Reference('behat3_symfony_extension.kernel'),
50
                '%mink.base_url%',
51
                '%behat3_symfony_extension.kernel.reboot%',
52
            )
53
        );
54
    }
55
}
56