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

[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

Open
BafS wants to merge1 commit intosymfony:8.0
base:8.0
Choose a base branch
Loading
fromBafS:remove-traits-from-kerneltestcase-1

Conversation

@BafS
Copy link
Contributor

@BafSBafS commentedNov 25, 2025
edited
Loading

QA
Branch?9.0
Bug fix?no
New feature?yes (BC)
Deprecations?no
IssuesFix #...
LicenseMIT

MailerAssertionsTrait andNotificationAssertionsTrait are rarely used in many tests in a typical Symfony application, yet they come by default in theKernelTestCase which unnecessarily bloats the class by adding 34 methods.

In our codebase we duplicatedKernelTestCase to 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.

@carsonbot
Copy link

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".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@carsonbotcarsonbot changed the titleDraft: Remove traits from KernelTestCase Draft: Remove traits from KernelTestCaseNov 25, 2025
@BafSBafS changed the title Draft: Remove traits from KernelTestCase Draft: [FrameworkBundle] Remove traits from KernelTestCaseNov 25, 2025
@BafSBafS changed the title Draft: [FrameworkBundle] Remove traits from KernelTestCase[FrameworkBundle] Remove traits from KernelTestCaseNov 25, 2025
@stof
Copy link
Member

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
Copy link
ContributorAuthor

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
Copy link
Member

as it is only related to tests.

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).

I saw some new features in RC.1

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
Copy link
ContributorAuthor

All right, thanks for the explanations. I'll wait 2 years and target 9.0 when it makes sense.

@derrabus
Copy link
Member

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.

xabbuh and BafS reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

8.0

Development

Successfully merging this pull request may close these issues.

4 participants

@BafS@carsonbot@stof@derrabus

[8]ページ先頭

©2009-2025 Movatter.jp