Skip to content

Commit

Permalink
IBX-3451: [Behat] Removed depending on APP_ENV when loading Context s…
Browse files Browse the repository at this point in the history
…ervices
  • Loading branch information
mnocon committed Jul 28, 2022
1 parent 55cdd6b commit 9a41f78
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 9a41f78

Please sign in to comment.