Skip to content

Test\Passed event is not emitted for PHPT tests #5898

@Bilge

Description

@Bilge
Q A
PHPUnit version 10.5.27
PHP version 8.2.15
Installation Method Composer

Summary

When a test succeeds, it usually emits the PHPUnit\Event\Test\Passed event. When it fails (an assertion), it emits PHPUnit\Event\Test\Failed. However, PHPT tests do not follow suit; they do correctly emit the Failed event, but the Passed event is not so emitted. They do emit AssertionSucceeded, 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\Passed event when they pass.

How to reproduce

Write PHPT test with --EXPECTF-- section that passes.

Expected behavior

PHPUnit\Event\Test\Passed event is emitted.

Metadata

Metadata

Labels

feature/eventsIssues related to PHPUnit's event systemfeature/phptEnd-to-end tests in PHPT formatfeature/test-runnerCLI test runnertype/bugSomething is brokenversion/10Something affects PHPUnit 10version/11Something affects PHPUnit 11

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions