8000 [FrameworkBundle] KernelTestCase: allow to provide the kernel class with a var by ogizanagi · Pull Request #22668 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] KernelTestCase: allow to provide the kernel class with a var #22668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ private static function getPhpUnitCliConfigArgument()
*/
protected static function getKernelClass()
{
if (isset($_SERVER['KERNEL_CLASS'])) {
if (!class_exists($class = $_SERVER['KERNEL_CLASS'])) {
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));
}

return $class;
}

if (isset($_SERVER['KERNEL_DIR'])) {
$dir = $_SERVER['KERNEL_DIR'];

Expand Down
0