Skip to content

Commit 1124932

Browse files
Merge branch '3.3' into 3.4
* 3.3: Revert "bug #24105 [Filesystem] check permissions if dump target dir is missing (xabbuh)" [Filesystem] skip tests if not applicable [Fabbot] Do not run php-cs-fixer if there are no change in src/ [Security] Fix exception when use_referer option is true and referer is not set or empty [HttpKernel] "controller.service_arguments" services should be public Get KERNEL_DIR through $_ENV too for KernelTestCase Get KERNEL_CLASS through $_ENV too check permissions if dump target dir is missing
2 parents 3a43e8a + e41df19 commit 1124932

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Test/KernelTestCase.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ private static function getPhpUnitCliConfigArgument()
114114
*/
115115
protected static function getKernelClass()
116116
{
117-
if (isset($_SERVER['KERNEL_CLASS'])) {
118-
if (!class_exists($class = $_SERVER['KERNEL_CLASS'])) {
117+
if (isset($_SERVER['KERNEL_CLASS']) || isset($_ENV['KERNEL_CLASS'])) {
118+
$class = isset($_SERVER['KERNEL_CLASS']) ? $_SERVER['KERNEL_CLASS'] : $_ENV['KERNEL_CLASS'];
119+
if (!class_exists($class)) {
119120
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));
120121
}
121122

@@ -124,8 +125,8 @@ protected static function getKernelClass()
124125
@trigger_error(sprintf('Using the KERNEL_DIR environment variable or the automatic guessing based on the phpunit.xml / phpunit.xml.dist file location is deprecated since 3.4. Set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel instead. Not setting the KERNEL_CLASS environment variable will throw an exception on 4.0 unless you override the %1$::createKernel() or %1$::getKernelClass() method.', static::class), E_USER_DEPRECATED);
125126
}
126127

127-
if (isset($_SERVER['KERNEL_DIR'])) {
128-
$dir = $_SERVER['KERNEL_DIR'];
128+
if (isset($_SERVER['KERNEL_DIR']) || isset($_ENV['KERNEL_DIR'])) {
129+
$dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : $_ENV['KERNEL_DIR'];
129130

130131
if (!is_dir($dir)) {
131132
$phpUnitDir = static::getPhpUnitXmlDir();

0 commit comments

Comments
 (0)