Skip to content
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

Fix KernelTestCase compatibility for PhpUnit 8 #30084

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
Expand Up @@ -208,6 +208,8 @@ protected static function createKernel(array $options = [])
}

/**
* @after
*
* Shuts the kernel down if it was used in the test.
*/
protected static function ensureKernelShutdown()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please confirm it works even if this method is protected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm it was called in a simple test extending the KernelTestCase.

Expand All @@ -220,12 +222,4 @@ protected static function ensureKernelShutdown()
}
}
}

/**
* Clean up Kernel usage in this test.
*/
protected function tearDown()
{
static::ensureKernelShutdown();
}
}