Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitfda994b

Browse files
bug#24113 [FrameworkBundle] Get KERNEL_CLASS through $_ENV too for KernelTestCase (yceruto)
This PR was merged into the 3.3 branch.Discussion----------[FrameworkBundle] Get KERNEL_CLASS through $_ENV too for KernelTestCase| Q | A| ------------- | ---| Branch? | 3.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |https://github.com/symfony/recipes/pull/170/files#diff-793b024840ee04ebdff5e04c2cd44f8cR12| License | MIT| Doc PR | -I guess the check could be simplied in `master` with php7+/cc@nicolas-grekasCommits-------73cdb68 Get KERNEL_CLASS through $_ENV too
2 parents5f5ed69 +73cdb68 commitfda994b

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
protectedstaticfunctiongetKernelClass()
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
thrownew \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)

[8]ページ先頭

©2009-2025 Movatter.jp