Skip to content

Conversation

mondrake
Copy link
Contributor

@mondrake mondrake commented Aug 1, 2025

Fixes #6102.

@mondrake mondrake changed the title Fix expectUserDeprecationMessage*() failure when test is run in separate process Fix expectUserDeprecationMessage*() failure when test is run in separate process Aug 1, 2025
@mondrake mondrake changed the title Fix expectUserDeprecationMessage*() failure when test is run in separate process WIP: Fix expectUserDeprecationMessage*() failure when test is run in separate process Aug 1, 2025
@mondrake mondrake changed the title WIP: Fix expectUserDeprecationMessage*() failure when test is run in separate process Fix expectUserDeprecationMessage*() failure when test is run in separate process Aug 1, 2025
@@ -0,0 +1,38 @@
--TEST--
Copy link
Contributor

Choose a reason for hiding this comment

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

could we have a better test name then 6102-1 and 6102-2. something which reflects the difference of the 2 tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would 6102-cli-argument and 6102-class-attribute be more relevant?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would go with something like
6102-process-isolated-arg
6102-separate-processes-attribute

Choose a reason for hiding this comment

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

How about 6102-process-isolation-via-attribute.phpt and 6102-process-isolation-via-cli-option.phpt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

afk at the moment, will look into it when possible if noone beats me at it

@sebastianbergmann
Copy link
Owner

Cherry-picked into 11.5, cleaned up, and merged to 12.3 and main from there.

@mondrake mondrake deleted the dev-6102 branch August 15, 2025 21:26
nicolas-grekas added a commit to symfony/symfony that referenced this pull request Aug 21, 2025
…ionMessage() method (xabbuh)

This PR was merged into the 7.4 branch.

Discussion
----------

[HttpFoundation] use PHPUnit's native expectUserDeprecationMessage() method

| Q             | A
| ------------- | ---
| Branch?       | 7.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

In #58370 I rewrote the tests in `NativeSessionStorageTest` to work around a bug in PHPUnit that didn't allow to have assertions about deprecations triggered in tests that were run in separate processes. Thanks to sebastianbergmann/phpunit#6283 (available in e.g. PHPUnit 12.3.5+) we don't need this workaround anymore.

Commits
-------

c7b14f8 use PHPUnit's native expectUserDeprecationMessage() method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants