Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.8k
[FrameworkBundle] Remove traits from KernelTestCase#62510
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:8.0
Are you sure you want to change the base?
Conversation
carsonbot commentedNov 25, 2025
Hey! Thanks for your PR. You are targeting branch "8.0" but it seems your PR description refers to branch "8.1 for features / 6.4, 7.3, 7.4, 8.0 for bug fixes". Cheers! Carsonbot |
stof commentedNov 26, 2025
It is too late to do such BC break in 8.0. The feature freeze was 2 months ago, and the final release will happen in a few days. |
BafS commentedNov 26, 2025
I saw some new features in RC.1, I was wondering if this could still be an exception, as it is only related to tests. Otherwise, I should target v9.0? |
stof commentedNov 26, 2025
it is not related to tests of the Symfony package. It is about testing utilities that are part of the public API of the package (and so covered by semver).
The features listed in the RC1 announcement (there's only 2 of them) are actually not whole new features. They are adjustments to features that were already merged earlier based on the feedback we got from people testing our beta releases. |
BafS commentedNov 26, 2025
All right, thanks for the explanations. I'll wait 2 years and target 9.0 when it makes sense. |
derrabus commentedNov 26, 2025
A BC break needs to be prepared with a deprecation layer and this can be done for 8.1 already. A test that is going to break in 9.0 must trigger a runtime deprecation on 8.x. |
Uh oh!
There was an error while loading.Please reload this page.
MailerAssertionsTraitandNotificationAssertionsTraitare rarely used in many tests in a typical Symfony application, yet they come by default in theKernelTestCasewhich unnecessarily bloats the class by adding 34 methods.In our codebase we duplicated
KernelTestCaseto avoid having methods that are unusable (because we don't use the mailer and the notifier), which is hacky. Unfortunately, PHP provides no way to "unuse" traits.I propose removing these traits from the test case. It is a BC break (for tests only), but easy for new applications to adapt to, and makes the test case more composable.