Allow "APP_ENV" and "APP_DEBUG" server/env variables set in bootstrap to affect kernel arguments
This commit is contained in:
@@ -130,6 +130,29 @@ Feature: Configuring application kernel
|
|||||||
When I run Behat
|
When I run Behat
|
||||||
Then it should pass
|
Then it should pass
|
||||||
|
|
||||||
|
Scenario: Using environment based on a server variable set in the bootstrap file
|
||||||
|
Given a feature file containing:
|
||||||
|
"""
|
||||||
|
Feature:
|
||||||
|
Scenario:
|
||||||
|
And the application kernel should have environment "custom"
|
||||||
|
"""
|
||||||
|
And a Behat configuration containing:
|
||||||
|
"""
|
||||||
|
default:
|
||||||
|
extensions:
|
||||||
|
FriendsOfBehat\SymfonyExtension:
|
||||||
|
bootstrap: config/bootstrap.php
|
||||||
|
"""
|
||||||
|
And a bootstrap file "config/bootstrap.php" containing:
|
||||||
|
"""
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$_SERVER['APP_ENV'] = 'custom';
|
||||||
|
"""
|
||||||
|
When I run Behat
|
||||||
|
Then it should pass
|
||||||
|
|
||||||
Scenario: Using debug based on Behat configuration
|
Scenario: Using debug based on Behat configuration
|
||||||
Given a Behat configuration containing:
|
Given a Behat configuration containing:
|
||||||
"""
|
"""
|
||||||
@@ -201,3 +224,26 @@ Feature: Configuring application kernel
|
|||||||
And an environment variable "APP_DEBUG" set to "1"
|
And an environment variable "APP_DEBUG" set to "1"
|
||||||
When I run Behat
|
When I run Behat
|
||||||
Then it should pass
|
Then it should pass
|
||||||
|
|
||||||
|
Scenario: Using debug based on a server variable set in the bootstrap file
|
||||||
|
Given a feature file containing:
|
||||||
|
"""
|
||||||
|
Feature:
|
||||||
|
Scenario:
|
||||||
|
And the application kernel should have debug disabled
|
||||||
|
"""
|
||||||
|
And a Behat configuration containing:
|
||||||
|
"""
|
||||||
|
default:
|
||||||
|
extensions:
|
||||||
|
FriendsOfBehat\SymfonyExtension:
|
||||||
|
bootstrap: config/bootstrap.php
|
||||||
|
"""
|
||||||
|
And a bootstrap file "config/bootstrap.php" containing:
|
||||||
|
"""
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$_SERVER['APP_DEBUG'] = '0';
|
||||||
|
"""
|
||||||
|
When I run Behat
|
||||||
|
Then it should pass
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ final class SymfonyExtension implements Extension
|
|||||||
|
|
||||||
public function load(ContainerBuilder $container, array $config): void
|
public function load(ContainerBuilder $container, array $config): void
|
||||||
{
|
{
|
||||||
$container->setParameter('fob_symfony.bootstrap', $config['bootstrap']);
|
$this->processBootstrap($this->autodiscoverBootstrap($config['bootstrap']));
|
||||||
|
|
||||||
$this->loadKernel($container, $this->autodiscoverKernelConfiguration($config['kernel']));
|
$this->loadKernel($container, $this->autodiscoverKernelConfiguration($config['kernel']));
|
||||||
$this->loadDriverKernel($container);
|
$this->loadDriverKernel($container);
|
||||||
@@ -86,7 +86,6 @@ final class SymfonyExtension implements Extension
|
|||||||
|
|
||||||
public function process(ContainerBuilder $container): void
|
public function process(ContainerBuilder $container): void
|
||||||
{
|
{
|
||||||
$this->processBootstrap($this->autodiscoverBootstrap($container->getParameter('fob_symfony.bootstrap')));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function registerMinkDriver(ExtensionManager $extensionManager): void
|
private function registerMinkDriver(ExtensionManager $extensionManager): void
|
||||||
|
|||||||
Reference in New Issue
Block a user