Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f9b343c

Browse filesBrowse files
committed
fixed $_ENV/$_SERVER precedence in test framework
1 parent e6d949b commit f9b343c
Copy full SHA for f9b343c

File tree

1 file changed

+6
-6
lines changed
Filter options

1 file changed

+6
-6
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private static function getPhpUnitCliConfigArgument()
107107
protected static function getKernelClass()
108108
{
109109
if (isset($_SERVER['KERNEL_CLASS']) || isset($_ENV['KERNEL_CLASS'])) {
110-
$class = isset($_SERVER['KERNEL_CLASS']) ? $_SERVER['KERNEL_CLASS'] : $_ENV['KERNEL_CLASS'];
110+
$class = isset($_ENV['KERNEL_CLASS']) ? $_ENV['KERNEL_CLASS'] : $_SERVER['KERNEL_CLASS'];
111111
if (!class_exists($class)) {
112112
throw new \RuntimeException(sprintf('Class "%s" doesn\'t exist or cannot be autoloaded. Check that the KERNEL_CLASS value in phpunit.xml matches the fully-qualified class name of your Kernel or override the %s::createKernel() method.', $class, static::class));
113113
}
@@ -116,7 +116,7 @@ protected static function getKernelClass()
116116
}
117117

118118
if (isset($_SERVER['KERNEL_DIR']) || isset($_ENV['KERNEL_DIR'])) {
119-
$dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : $_ENV['KERNEL_DIR'];
119+
$dir = isset($_ENV['KERNEL_DIR']) ? $_ENV['KERNEL_DIR'] : $_SERVER['KERNEL_DIR'];
120120

121121
if (!is_dir($dir)) {
122122
$phpUnitDir = static::getPhpUnitXmlDir();
@@ -176,20 +176,20 @@ protected static function createKernel(array $options = array())
176176

177177
if (isset($options['environment'])) {
178178
$env = $options['environment'];
179-
} elseif (isset($_SERVER['APP_ENV'])) {
180-
$env = $_SERVER['APP_ENV'];
181179
} elseif (isset($_ENV['APP_ENV'])) {
182180
$env = $_ENV['APP_ENV'];
181+
} elseif (isset($_SERVER['APP_ENV'])) {
182+
$env = $_SERVER['APP_ENV'];
183183
} else {
184184
$env = 'test';
185185
}
186186

187187
if (isset($options['debug'])) {
188188
$debug = $options['debug'];
189-
} elseif (isset($_SERVER['APP_DEBUG'])) {
190-
$debug = $_SERVER['APP_DEBUG'];
191189
} elseif (isset($_ENV['APP_DEBUG'])) {
192190
$debug = $_ENV['APP_DEBUG'];
191+
} elseif (isset($_SERVER['APP_DEBUG'])) {
192+
$debug = $_SERVER['APP_DEBUG'];
193193
} else {
194194
$debug = true;
195195
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.