Skip to content

Commit

Permalink
[Behat] Removed depending on env when loading Context services
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Jul 26, 2022
1 parent 55cdd6b commit 656d4f4
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function load(array $configs, ContainerBuilder $container): void
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yaml');

$environment = $container->getParameter('kernel.environment');
if (in_array($environment, ['behat', 'test'])) {
$shouldLoadTestServices = $this->shouldLoadTestServices($container);
if ($shouldLoadTestServices) {
$loader->load('feature_contexts.yaml');
}
}
Expand All @@ -47,4 +47,10 @@ private function prependJMSTranslation(ContainerBuilder $container): void
],
]);
}

private function shouldLoadTestServices(ContainerBuilder $container): bool
{
return $container->hasParameter('ibexa.testing.browser.enabled')
&& true === $container->getParameter('ibexa.testing.browser.enabled');
}
}

0 comments on commit 656d4f4

Please sign in to comment.