sebastianbergmann / sebastianbergmann/phpunit
Move/Rename events for issues triggered outside of tests
@sebastianbergmann is already working on this.
Since Apr 11, 2026.
- Dominant language
- PHP
- Stars
- 20.1k
- Forks
- 2.2k
- Avg merge
- 7h
- Merged PRs (30d)
- 61
Description
The new events introduced in #6579 for E_USER_DEPRECATION, E_USER_NOTICE, and E_USER_WARNING triggered outside of tests would naturally live in the PHPUnit\Event\TestRunner namespace as DeprecationTriggered, NoticeTriggered, and WarningTriggered. However, those names are already taken by existing event classes that represent something entirely different:
| Current name | What it represents | Should have been named |
|---|---|---|
TestRunner\DeprecationTriggered |
PHPUnit itself reporting a deprecation about the test runner | TestRunner\PhpunitDeprecationTriggered |
TestRunner\NoticeTriggered |
PHPUnit itself reporting a notice about the test runner | TestRunner\PhpunitNoticeTriggered |
TestRunner\WarningTriggered |
PHPUnit itself reporting a warning about the test runner | TestRunner\PhpunitWarningTriggered |
The regular deprecation process (deprecate old name, introduce new name, give consumers a migration window) cannot be applied here. After the renames, TestRunner\DeprecationTriggered would still exist but with a completely different meaning. Any subscriber implementing TestRunner\DeprecationTriggeredSubscriber would receive a structurally different object. There is no way to have both the old and new meaning coexist under the same fully-qualified class name.
For PHPUnit 13, the new events live in the PHPUnit\Event\TestRunner\Issue sub-namespace as a temporary home. The @todo annotations document the plan for PHPUnit 14:
- The existing
TestRunner\DeprecationTriggered(andNoticeTriggered,WarningTriggered) will be renamed toTestRunner\PhpunitDeprecationTriggered(andPhpunitNoticeTriggered,PhpunitWarningTriggered) - The new
TestRunner\Issue\DeprecationTriggered(andNoticeTriggered,WarningTriggered) will be moved up toTestRunner\DeprecationTriggered(andNoticeTriggered,WarningTriggered) - The same applies to the corresponding
Subscriberinterfaces
This must be a hard break in PHPUnit 14 because both sides of the collision need to be reshuffled simultaneously.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.