-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Test\Passed event is not emitted for PHPT tests #5898
Copy link
Copy link
Closed
Labels
feature/eventsIssues related to PHPUnit's event systemIssues related to PHPUnit's event systemfeature/phptEnd-to-end tests in PHPT formatEnd-to-end tests in PHPT formatfeature/test-runnerCLI test runnerCLI test runnertype/bugSomething is brokenSomething is brokenversion/10Something affects PHPUnit 10Something affects PHPUnit 10version/11Something affects PHPUnit 11Something affects PHPUnit 11
Metadata
Metadata
Assignees
Labels
feature/eventsIssues related to PHPUnit's event systemIssues related to PHPUnit's event systemfeature/phptEnd-to-end tests in PHPT formatEnd-to-end tests in PHPT formatfeature/test-runnerCLI test runnerCLI test runnertype/bugSomething is brokenSomething is brokenversion/10Something affects PHPUnit 10Something affects PHPUnit 10version/11Something affects PHPUnit 11Something affects PHPUnit 11
Summary
When a test succeeds, it usually emits the
PHPUnit\Event\Test\Passedevent. When it fails (an assertion), it emitsPHPUnit\Event\Test\Failed. However, PHPT tests do not follow suit; they do correctly emit theFailedevent, but thePassedevent is not so emitted. They do emitAssertionSucceeded, but as this is marked@deprecated, one supposes one cannot rely on this (and it is removed in v11).Current behavior
PHPT tests do not emit the
PHPUnit\Event\Test\Passedevent when they pass.How to reproduce
Write PHPT test with
--EXPECTF--section that passes.Expected behavior
PHPUnit\Event\Test\Passedevent is emitted.