Skip to content

Commit

Permalink
Adapt to the new structure
Browse files Browse the repository at this point in the history
Use class detection to determine what the most sensible defaults are, so
that this extension requires even less configuration.
With recent versions of Symfony, the bootstrap is not required anymore,
nor is requiring the kernel file.
Fixes #140
  • Loading branch information
greg0ire committed May 22, 2018
1 parent d7c8344 commit fd82f9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ configure Symfony2 kernel inside Behat to fulfil all your needs.
or a path relative to the Behat configuration file. Defaults to ``app/autoload.php``.
- ``path`` - defines the path to the kernel class file in order to instantiate it. It
can be an absolute path or a path relative to the Behat configuration file. Defaults
to ``app/AppKernel.php``.
- ``class`` - defines the name of the kernel class. Defaults to ``AppKernel``.
to ``app/AppKernel.php`` or ``src/Kernel.php``, whichever exists.
- ``class`` - defines the name of the kernel class. Defaults to
``AppKernel`` or ``App\Kernel``, whichever exists.
- ``env`` - defines the environment in which kernel should be instantiated and used
inside suite. Defaults to ``test``.
- ``debug`` - defines whether kernel should be instantiated with ``debug`` option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public function configure(ArrayNodeDefinition $builder)
->arrayNode('kernel')
->addDefaultsIfNotSet()
->children()
->scalarNode('bootstrap')->defaultValue(self::DEFAULT_KERNEL_BOOTSTRAP)->end()
->scalarNode('path')->defaultValue('app/AppKernel.php')->end()
->scalarNode('class')->defaultValue('AppKernel')->end()
->scalarNode('bootstrap')->defaultValue(class_exists('App\Kernel') ? null : self::DEFAULT_KERNEL_BOOTSTRAP)->end()
->scalarNode('path')->defaultValue(class_exists('App\Kernel') ? null : 'app/AppKernel.php')->end()
->scalarNode('class')->defaultValue(class_exists('App\Kernel') ? 'App\Kernel' : 'AppKernel')->end()
->scalarNode('env')->defaultValue('test')->end()
->booleanNode('debug')
->beforeNormalization()
Expand Down

0 comments on commit fd82f9e

Please sign in to comment.