Skip to content

Commit 005cf6b

Browse files
Merge branch '3.3' into 3.4
* 3.3: Fix travis php7.0 Add support to environment variables APP_ENV/DEBUG in KernelTestCase [Routing] Cleanup apache fixtures
2 parents 30a13ba + 19e5ed1 commit 005cf6b

File tree

4 files changed

+22
-180
lines changed

4 files changed

+22
-180
lines changed

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ matrix:
2727
- php: 5.6
2828
- php: 7.1
2929
env: deps=high
30-
- php: 7.0.8
30+
- php: 7.0
3131
env: deps=low
3232
fast_finish: true
3333

@@ -128,11 +128,6 @@ before_install:
128128
129129
- |
130130
# Install extra PHP extensions
131-
if [[ ! $skip && $PHP = 7.0.* ]]; then
132-
wget https://github.com/symfony/binary-utils/releases/download/v0.1/ldap-php70.tar.bz2
133-
tar -xjf ldap-php70.tar.bz2
134-
echo extension = $(pwd)/ldap.so >> $INI
135-
fi
136131
if [[ ! $skip && $PHP = 5.* ]]; then
137132
([[ $deps ]] || tfold ext.symfony_debug 'cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> '"$INI") &&
138133
tfold ext.apcu4 'echo yes | pecl install -f apcu-4.0.11'

src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,27 @@ protected static function createKernel(array $options = array())
188188
static::$class = static::getKernelClass();
189189
}
190190

191-
return new static::$class(
192-
isset($options['environment']) ? $options['environment'] : 'test',
193-
isset($options['debug']) ? $options['debug'] : true
194-
);
191+
if (isset($options['environment'])) {
192+
$env = $options['environment'];
193+
} elseif (isset($_SERVER['APP_ENV'])) {
194+
$env = $_SERVER['APP_ENV'];
195+
} elseif (isset($_ENV['APP_ENV'])) {
196+
$env = $_ENV['APP_ENV'];
197+
} else {
198+
$env = 'test';
199+
}
200+
201+
if (isset($options['debug'])) {
202+
$debug = $options['debug'];
203+
} elseif (isset($_SERVER['APP_DEBUG'])) {
204+
$debug = $_SERVER['APP_DEBUG'];
205+
} elseif (isset($_ENV['APP_DEBUG'])) {
206+
$debug = $_ENV['APP_DEBUG'];
207+
} else {
208+
$debug = true;
209+
}
210+
211+
return new static::$class($env, $debug);
195212
}
196213

197214
/**

src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache

Lines changed: 0 additions & 163 deletions
This file was deleted.

src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)