File tree Expand file tree Collapse file tree 5 files changed +17
-12
lines changed Expand file tree Collapse file tree 5 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ matrix:
1717 - php : ' 7.0'
1818 - php : ' 7.1'
1919 - php : ' 7.2'
20+ - php : ' 7.2'
21+ env : coverage=1
2022 - php : ' 7.2'
2123 env : lint=1
2224 - php : ' 7.2'
2325 env : deps=low
24- - php : ' 7.2'
25- env : coverage=1
2626 - php : ' 7.2'
2727 env : SYMFONY_DEPRECATIONS_HELPER=0
2828 - php : ' 7.2'
@@ -75,9 +75,9 @@ install:
7575
7676script :
7777 - if [[ $coverage = 1 ]]; then
78- phpdbg -qrr vendor/bin/phpunit --coverage-php build/cov/coverage-phpunit.cov;
78+ APP_ENV=test_phpunit phpdbg -qrr vendor/bin/phpunit --coverage-php build/cov/coverage-phpunit.cov;
7979 elif [[ $lint != 1 ]]; then
80- vendor/bin/phpunit;
80+ APP_ENV=test_phpunit vendor/bin/phpunit;
8181 fi
8282 - if [[ $coverage = 1 ]]; then
8383 for f in $(find features -name '*.feature' -not -path 'features/main/exposed_state.feature'); do
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ default:
3131 extensions:
3232 'Behat\Symfony2Extension':
3333 kernel:
34- env: '%env(APP_ENV)% '
34+ env: 'test '
3535 debug: 'true'
3636 path: 'tests/Fixtures/app/AppKernel.php'
3737 bootstrap: 'tests/Fixtures/app/bootstrap.php'
Original file line number Diff line number Diff line change 1212 <ini name =" memory_limit" value =" -1" />
1313 <server name =" KERNEL_DIR" value =" tests/Fixtures/app/" />
1414 <server name =" KERNEL_CLASS" value =" AppKernel" />
15+ <server name =" APP_ENV" value =" test_phpunit" />
1516 <server name =" LEGACY" value =" 0" />
1617 </php >
1718
Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ class AppKernel extends Kernel
3838{
3939 use MicroKernelTrait;
4040
41+ public function __construct (string $ environment , bool $ debug )
42+ {
43+ parent ::__construct ($ environment , $ debug );
44+
45+ // patch for behat/symfony2-extension not supporting %env(APP_ENV)%
46+ $ this ->environment = $ _SERVER ['APP_ENV ' ] ?? $ environment ;
47+ }
48+
4149 public function registerBundles (): array
4250 {
4351 $ bundles = [
@@ -69,15 +77,9 @@ protected function configureRoutes(RouteCollectionBuilder $routes)
6977
7078 protected function configureContainer (ContainerBuilder $ c , LoaderInterface $ loader )
7179 {
72- $ environment = $ this ->getEnvironment ();
7380 $ c ->setParameter ('kernel.project_dir ' , __DIR__ );
7481
75- // patch for behat not supporting %env(APP_ENV)% in older versions
76- if (($ appEnv = $ _SERVER ['APP_ENV ' ] ?? 'test ' ) && $ appEnv !== $ environment ) {
77- $ environment = $ appEnv ;
78- }
79-
80- $ loader ->load ("{$ this ->getRootDir ()}/config/config_ {$ environment }.yml " );
82+ $ loader ->load ("{$ this ->getRootDir ()}/config/config_ {$ this ->getEnvironment ()}.yml " );
8183
8284 $ securityConfig = [
8385 'encoders ' => [
Original file line number Diff line number Diff line change 1+ imports :
2+ - { resource: config_test.yml }
You can’t perform that action at this time.
0 commit comments