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:
17
17
- php : ' 7.0'
18
18
- php : ' 7.1'
19
19
- php : ' 7.2'
20
+ - php : ' 7.2'
21
+ env : coverage=1
20
22
- php : ' 7.2'
21
23
env : lint=1
22
24
- php : ' 7.2'
23
25
env : deps=low
24
- - php : ' 7.2'
25
- env : coverage=1
26
26
- php : ' 7.2'
27
27
env : SYMFONY_DEPRECATIONS_HELPER=0
28
28
- php : ' 7.2'
@@ -75,9 +75,9 @@ install:
75
75
76
76
script :
77
77
- 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;
79
79
elif [[ $lint != 1 ]]; then
80
- vendor/bin/phpunit;
80
+ APP_ENV=test_phpunit vendor/bin/phpunit;
81
81
fi
82
82
- if [[ $coverage = 1 ]]; then
83
83
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:
31
31
extensions:
32
32
'Behat\Symfony2Extension':
33
33
kernel:
34
- env: '%env(APP_ENV)% '
34
+ env: 'test '
35
35
debug: 'true'
36
36
path: 'tests/Fixtures/app/AppKernel.php'
37
37
bootstrap: 'tests/Fixtures/app/bootstrap.php'
Original file line number Diff line number Diff line change 12
12
<ini name =" memory_limit" value =" -1" />
13
13
<server name =" KERNEL_DIR" value =" tests/Fixtures/app/" />
14
14
<server name =" KERNEL_CLASS" value =" AppKernel" />
15
+ <server name =" APP_ENV" value =" test_phpunit" />
15
16
<server name =" LEGACY" value =" 0" />
16
17
</php >
17
18
Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ class AppKernel extends Kernel
38
38
{
39
39
use MicroKernelTrait;
40
40
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
+
41
49
public function registerBundles (): array
42
50
{
43
51
$ bundles = [
@@ -69,15 +77,9 @@ protected function configureRoutes(RouteCollectionBuilder $routes)
69
77
70
78
protected function configureContainer (ContainerBuilder $ c , LoaderInterface $ loader )
71
79
{
72
- $ environment = $ this ->getEnvironment ();
73
80
$ c ->setParameter ('kernel.project_dir ' , __DIR__ );
74
81
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 " );
81
83
82
84
$ securityConfig = [
83
85
'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