Skip to content

Commit

Permalink
Merge pull request #135 from Behat/throw-an-exception-only-if-bootstr…
Browse files Browse the repository at this point in the history
…ap-is-not-the-default-one

Throw an exception only if the bootstrap file is not the default one
  • Loading branch information
sroze authored Dec 13, 2017
2 parents 58ff140 + 1cda571 commit 022ece0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
class Symfony2Extension implements ExtensionInterface
{
const KERNEL_ID = 'symfony2_extension.kernel';
const DEFAULT_KERNEL_BOOTSTRAP = 'app/autoload.php';

/**
* {@inheritdoc}
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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"'
);
Expand Down

0 comments on commit 022ece0

Please sign in to comment.