-
Notifications
You must be signed in to change notification settings - Fork 4
/
PhpSpecExtension.php
62 lines (53 loc) · 1.54 KB
/
PhpSpecExtension.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
namespace RMiller\BehatSpec\Extension\PhpSpecExtension;
use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface;
use Behat\Testwork\ServiceContainer\ExtensionManager;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
class PhpSpecExtension implements ExtensionInterface
{
/**
* {@inheritDoc}
*/
public function load(ContainerBuilder $container, array $config)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__));
$loader->load('services.xml');
$container->setParameter('phpspec_extension.path', $config['path']);
$container->setParameter('phpspec_extension.config', $config['config']);
}
/**
* {@inheritDoc}
*/
public function configure(ArrayNodeDefinition $builder)
{
$builder
->addDefaultsIfNotSet()
->children()
->scalarNode('path')->defaultValue('bin/phpspec')->end()
->scalarNode('config')->defaultValue('phpspec.yml')->end()
->end()
->end();
}
/**
* {@inheritDoc}
*/
public function getConfigKey()
{
return 'phpspec';
}
/**
* {@inheritdoc}
*/
public function initialize(ExtensionManager $extensionManager)
{
}
/**
* {@inheritDoc}
*/
public function process(ContainerBuilder $container)
{
}
}