From 1cda571d71f16ea1a66778aa798ca64d3b2a6a5c Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Tue, 28 Nov 2017 16:29:49 +0000 Subject: [PATCH] Throw an exception only if the bootstrap file is not the default one --- .../Symfony2Extension/ServiceContainer/Symfony2Extension.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Behat/Symfony2Extension/ServiceContainer/Symfony2Extension.php b/src/Behat/Symfony2Extension/ServiceContainer/Symfony2Extension.php index eab6e80..273ddb6 100644 --- a/src/Behat/Symfony2Extension/ServiceContainer/Symfony2Extension.php +++ b/src/Behat/Symfony2Extension/ServiceContainer/Symfony2Extension.php @@ -34,6 +34,7 @@ class Symfony2Extension implements ExtensionInterface { const KERNEL_ID = 'symfony2_extension.kernel'; + const DEFAULT_KERNEL_BOOTSTRAP = 'app/autoload.php'; /** * {@inheritdoc} @@ -70,7 +71,7 @@ public function configure(ArrayNodeDefinition $builder) ->arrayNode('kernel') ->addDefaultsIfNotSet() ->children() - ->scalarNode('bootstrap')->defaultValue('app/autoload.php')->end() + ->scalarNode('bootstrap')->defaultValue(self::DEFAULT_KERNEL_BOOTSTRAP)->end() ->scalarNode('path')->defaultValue('app/AppKernel.php')->end() ->scalarNode('class')->defaultValue('AppKernel')->end() ->scalarNode('env')->defaultValue('test')->end() @@ -125,7 +126,7 @@ public function process(ContainerBuilder $container) require_once($bootstrap); } elseif (file_exists($bootstrapPath)) { require_once($bootstrapPath); - } else { + } elseif ($bootstrapPath !== self::DEFAULT_KERNEL_BOOTSTRAP) { throw new ProcessingException( 'Could not load bootstrap file. Please check your configuration at "kernel.bootstrap"' );