Fix review feedback
This commit is contained in:
@@ -18,6 +18,7 @@ before_install:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- composer require symfony/http-kernel:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist
|
- composer require symfony/http-kernel:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist
|
||||||
|
- composer require symfony/dotenv:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist
|
||||||
- composer require --dev symfony/framework-bundle:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist
|
- composer require --dev symfony/framework-bundle:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist
|
||||||
- composer update --prefer-dist
|
- composer update --prefer-dist
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
"behat/behat": "^3.1",
|
"behat/behat": "^3.1",
|
||||||
"symfony/http-kernel": "^3.3|^4.0",
|
"symfony/http-kernel": "^3.3|^4.0",
|
||||||
"symfony/dotenv": "^4.0"
|
"symfony/dotenv": "^3.3|^4.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"behat/mink": "^1.7",
|
"behat/mink": "^1.7",
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ Feature: Not crashing Behat
|
|||||||
kernel:
|
kernel:
|
||||||
path: src/MyKernel.php
|
path: src/MyKernel.php
|
||||||
class: MyKernel
|
class: MyKernel
|
||||||
|
bootstrap: ~
|
||||||
"""
|
"""
|
||||||
And a file ".env_in_memory" containing:
|
And a file ".env_in_memory" containing:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -61,6 +61,16 @@ final class SymfonyExtension implements Extension
|
|||||||
*/
|
*/
|
||||||
const SHARED_KERNEL_CONTAINER_ID = 'sylius_symfony_extension.shared_kernel.container';
|
const SHARED_KERNEL_CONTAINER_ID = 'sylius_symfony_extension.shared_kernel.container';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default symfony environment used to run your suites.
|
||||||
|
*/
|
||||||
|
private const DEFAULT_ENV = 'test';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable or disable the debug mode
|
||||||
|
*/
|
||||||
|
private const DEBUG_MODE = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var CrossContainerProcessor|null
|
* @var CrossContainerProcessor|null
|
||||||
*/
|
*/
|
||||||
@@ -115,10 +125,11 @@ final class SymfonyExtension implements Extension
|
|||||||
if (null !== $config['env_file']) {
|
if (null !== $config['env_file']) {
|
||||||
$this->loadEnvVars($container, $config['env_file']);
|
$this->loadEnvVars($container, $config['env_file']);
|
||||||
|
|
||||||
$environment = getenv('APP_ENV');
|
$environment = false !== getenv('APP_ENV') ? getenv('APP_ENV') : self::DEFAULT_ENV;
|
||||||
$config['kernel']['env'] = $environment ?? 'test';
|
$debugMode = false !== getenv('APP_DEBUG') ? getenv('APP_DEBUG') : self::DEBUG_MODE;
|
||||||
} else {
|
|
||||||
$this->requireKernelBootstrapFile($container->getParameter('paths.base'), $config['bootstrap']);
|
$config['kernel']['env'] = $environment;
|
||||||
|
$config['kernel']['kernel'] = $debugMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->loadKernel($container, $config['kernel']);
|
$this->loadKernel($container, $config['kernel']);
|
||||||
@@ -163,6 +174,8 @@ final class SymfonyExtension implements Extension
|
|||||||
$definition->setFile($this->getKernelFile($container->getParameter('paths.base'), $config['path']));
|
$definition->setFile($this->getKernelFile($container->getParameter('paths.base'), $config['path']));
|
||||||
|
|
||||||
$container->setDefinition(self::KERNEL_ID, $definition);
|
$container->setDefinition(self::KERNEL_ID, $definition);
|
||||||
|
|
||||||
|
$this->requireKernelBootstrapFile($container->getParameter('paths.base'), $config['bootstrap']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user