Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

EzBehatExtension.php
Go to the documentation of this file.
1 <?php
2
7 declare(strict_types=1);
8
9 namespace EzSystems\PlatformBehatBundle\ServiceContainer;
10
11 use Behat\Behat\EventDispatcher\ServiceContainer\EventDispatcherExtension;
12 use Behat\Symfony2Extension\ServiceContainer\Symfony2Extension;
13 use Behat\Testwork\ServiceContainer\Extension;
14 use Behat\Testwork\ServiceContainer\ExtensionManager;
15 use eZ\Bundle\PlatformBehatBundle\Initializer\BehatSiteAccessInitializer;
16 use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
17 use Symfony\Component\Config\FileLocator;
18 use Symfony\Component\DependencyInjection\ContainerBuilder;
19 use Symfony\Component\DependencyInjection\Definition;
20 use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
21 use Symfony\Component\DependencyInjection\Reference;
22
26 class EzBehatExtension implements Extension
27 {
28 public function getConfigKey()
29 {
30 return 'ezbehatextension';
31 }
32
33 public function process(ContainerBuilder $container)
34 {
35 }
36
37 public function initialize(ExtensionManager $extensionManager)
38 {
39 }
40
41 public function configure(ArrayNodeDefinition $builder)
42 {
43 }
44
51 public function load(ContainerBuilder $container, array $config)
52 {
53 $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
54 $loader->load('services.yml');
55
56 $this->loadSiteAccessInitializer($container);
57 }
58
59 private function loadSiteAccessInitializer(ContainerBuilder $container): void
60 {
61 $definition = new Definition(BehatSiteAccessInitializer::class);
62 $definition->setArguments([
63 new Reference(Symfony2Extension::KERNEL_ID),
64 ]);
65 $definition->addTag(EventDispatcherExtension::SUBSCRIBER_TAG, ['priority' => 0]);
66 $container->setDefinition(BehatSiteAccessInitializer::class, $definition);
67 }
68 }
EzSystems\PlatformBehatBundle\ServiceContainer\EzBehatExtension
EzBehatExtension loads extension specific services.
Definition: EzBehatExtension.php:27
EzSystems\PlatformBehatBundle\ServiceContainer\EzBehatExtension\configure
configure(ArrayNodeDefinition $builder)
Definition: EzBehatExtension.php:41
EzSystems\PlatformBehatBundle\ServiceContainer\EzBehatExtension\loadSiteAccessInitializer
loadSiteAccessInitializer(ContainerBuilder $container)
Definition: EzBehatExtension.php:59
EzSystems\PlatformBehatBundle\ServiceContainer\EzBehatExtension\process
process(ContainerBuilder $container)
Definition: EzBehatExtension.php:33
EzSystems\PlatformBehatBundle\ServiceContainer\EzBehatExtension\getConfigKey
getConfigKey()
Definition: EzBehatExtension.php:28
EzSystems\PlatformBehatBundle\ServiceContainer\EzBehatExtension\initialize
initialize(ExtensionManager $extensionManager)
Definition: EzBehatExtension.php:37
EzSystems\PlatformBehatBundle\ServiceContainer\EzBehatExtension\load
load(ContainerBuilder $container, array $config)
Loads extension services into temporary container.
Definition: EzBehatExtension.php:51
eZ\Bundle\PlatformBehatBundle\Initializer\BehatSiteAccessInitializer
Definition: BehatSiteAccessInitializer.php:20
$loader
$loader
Definition: containerBuilder.php:25
EzSystems\PlatformBehatBundle\ServiceContainer
Definition: EzBehatExtension.php:9
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.