Failed Conditions
Push — master ( 078b9e...43dee3 )
by Yo
02:10
created

Behat3SymfonyDriverFactory::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 2
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 1
    public function getDriverName()
16
    {
17 1
        return 'behat3Symfony';
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 1
    public function supportsJavascript()
24
    {
25 1
        return false;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function configure(ArrayNodeDefinition $builder)
32
    {
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38 1
    public function buildDriver(array $config)
39
    {
40 1
        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 1
        return new Definition(
47 1
            KernelDriver::class,
48
            array(
49 1
                new Reference('behat3_symfony_extension.kernel'),
50 1
                '%mink.base_url%',
51 1
                '%behat3_symfony_extension.kernel.reboot%',
52
            )
53 1
        );
54
    }
55
}
56