Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Commit 022ece0

Browse files
authored
Merge pull request #135 from Behat/throw-an-exception-only-if-bootstrap-is-not-the-default-one
Throw an exception only if the bootstrap file is not the default one
2 parents 58ff140 + 1cda571 commit 022ece0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Behat/Symfony2Extension/ServiceContainer/Symfony2Extension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
class Symfony2Extension implements ExtensionInterface
3535
{
3636
const KERNEL_ID = 'symfony2_extension.kernel';
37+
const DEFAULT_KERNEL_BOOTSTRAP = 'app/autoload.php';
3738

3839
/**
3940
* {@inheritdoc}
@@ -70,7 +71,7 @@ public function configure(ArrayNodeDefinition $builder)
7071
->arrayNode('kernel')
7172
->addDefaultsIfNotSet()
7273
->children()
73-
->scalarNode('bootstrap')->defaultValue('app/autoload.php')->end()
74+
->scalarNode('bootstrap')->defaultValue(self::DEFAULT_KERNEL_BOOTSTRAP)->end()
7475
->scalarNode('path')->defaultValue('app/AppKernel.php')->end()
7576
->scalarNode('class')->defaultValue('AppKernel')->end()
7677
->scalarNode('env')->defaultValue('test')->end()
@@ -125,7 +126,7 @@ public function process(ContainerBuilder $container)
125126
require_once($bootstrap);
126127
} elseif (file_exists($bootstrapPath)) {
127128
require_once($bootstrapPath);
128-
} else {
129+
} elseif ($bootstrapPath !== self::DEFAULT_KERNEL_BOOTSTRAP) {
129130
throw new ProcessingException(
130131
'Could not load bootstrap file. Please check your configuration at "kernel.bootstrap"'
131132
);

0 commit comments

Comments
 (0)