[FrameworkBundle] changed KernelTestCase::getKernelClass() to check $_SERVER['KERNEL_DIR'] before invoking getPhpUnitXmlDir()

This commit is contained in:
KUBO Atsuhiro 2014-07-11 13:00:56 +09:00 committed by Fabien Potencier
parent 4c97420fef
commit 6f58674832

View File

@ -100,14 +100,17 @@ abstract class KernelTestCase extends \PHPUnit_Framework_TestCase
*/ */
protected static function getKernelClass() protected static function getKernelClass()
{ {
$dir = $phpUnitDir = static::getPhpUnitXmlDir();
if (isset($_SERVER['KERNEL_DIR'])) { if (isset($_SERVER['KERNEL_DIR'])) {
$dir = $_SERVER['KERNEL_DIR']; $dir = $_SERVER['KERNEL_DIR'];
if (!is_dir($dir) && is_dir("$phpUnitDir/$dir")) { if (!is_dir($dir)) {
$dir = "$phpUnitDir/$dir"; $phpUnitDir = static::getPhpUnitXmlDir();
if (is_dir("$phpUnitDir/$dir")) {
$dir = "$phpUnitDir/$dir";
}
} }
} else {
$dir = static::getPhpUnitXmlDir();
} }
$finder = new Finder(); $finder = new Finder();