8000 Get KERNEL_CLASS through $_ENV too · symfony/symfony@73cdb68 · GitHub
[go: up one dir, main page]

Skip to content

Commit 73cdb68

Browse files
committed
Get KERNEL_CLASS through $_ENV too
1 parent 9431a38 commit 73cdb68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ private static function getPhpUnitCliConfigArgument()
106106
*/
107107
protected static function getKernelClass()
108108
{
109-
if (isset($_SERVER['KERNEL_CLASS'])) {
110-
if (!class_exists($class = $_SERVER['KERNEL_CLASS'])) {
109+
if (isset($_SERVER['KERNEL_CLASS']) || isset($_ENV['KERNEL_CLASS'])) {
110+
$class = isset($_SERVER['KERNEL_CLASS']) ? $_SERVER['KERNEL_CLASS'] : $_ENV['KERNEL_CLASS'];
111+
if (!class_exists($class)) {
111112
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));
112113
}
113114

0 commit comments

Comments
 (0)
0