File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ Feature: Configuring application kernel
81
81
Feature:
82
82
Scenario:
83
83
Then the application kernel should have environment "custom"
84
+ And the server and environment variable "APP_ENV" is "custom"
84
85
"""
85
86
When I run Behat
86
87
Then it should pass
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ public function configure(ArrayNodeDefinition $builder): void
71
71
72
72
public function load (ContainerBuilder $ container , array $ config ): void
73
73
{
74
- $ this ->fallbackToTestEnvironment ( );
74
+ $ this ->setupTestEnvironment ( $ config [ ' kernel ' ][ ' environment ' ] ?? ' test ' );
75
75
76
76
$ this ->loadBootstrap ($ this ->autodiscoverBootstrap ($ config ['bootstrap ' ]));
77
77
@@ -182,11 +182,11 @@ private function loadBootstrap(?string $bootstrap): void
182
182
require_once $ bootstrap ;
183
183
}
184
184
185
- private function fallbackToTestEnvironment ( ): void
185
+ private function setupTestEnvironment ( string $ fallback ): void
186
186
{
187
- // If there's no defined server / environment variable with an environment, default to test
187
+ // If there's no defined server / environment variable with an environment, default to configured fallback
188
188
if (($ _SERVER ['APP_ENV ' ] ?? $ _ENV ['APP_ENV ' ] ?? null ) === null ) {
189
- putenv ('APP_ENV= ' . $ _SERVER ['APP_ENV ' ] = $ _ENV ['APP_ENV ' ] = ' test ' );
189
+ putenv ('APP_ENV= ' . $ _SERVER ['APP_ENV ' ] = $ _ENV ['APP_ENV ' ] = $ fallback );
190
190
}
191
191
}
192
192
You can’t perform that action at this time.
0 commit comments