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 (#62)
  • Loading branch information
mnocon authored Aug 18, 2022
1 parent 3360129 commit 3496f9d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ 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'])) {
if ($this->shouldLoadTestServices($container)) {
$loader->load('feature_contexts.yaml');
}
}
Expand All @@ -47,4 +46,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 3496f9d

Please sign in to comment.