Skip to content

Commit 7b9d16e

Browse files
Merge branch '11.5' into 12.1
2 parents 7445126 + e78ff70 commit 7b9d16e

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

ChangeLog-12.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All notable changes of the PHPUnit 12.1 release series are documented in this fi
1313
### Fixed
1414

1515
* [#6173](https://github.com/sebastianbergmann/phpunit/issues/6173): Output from `error_log()` is not displayed when test fails
16+
* A "Before Test Method Errored" event is no longer emitted when a test is skipped in a "before test" method
1617

1718
## [12.1.2] - 2025-04-08
1819

src/Framework/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ private function invokeHookMethods(HookMethodCollection $hookMethods, Event\Emit
20972097

20982098
$methodsInvoked[] = $methodInvoked;
20992099

2100-
if (isset($t)) {
2100+
if (isset($t) && !$t instanceof SkippedTest) {
21012101
/** @phpstan-ignore method.dynamicName */
21022102
$emitter->{$erroredMethod}(
21032103
$test,

tests/end-to-end/event/test-skipped-in-setup.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Test Runner Execution Started (1 test)
2121
Test Suite Started (PHPUnit\TestFixture\Event\SkippedInSetupTest, 1 test)
2222
Test Preparation Started (PHPUnit\TestFixture\Event\SkippedInSetupTest::testOne)
2323
Before Test Method Called (PHPUnit\TestFixture\Event\SkippedInSetupTest::setUp)
24-
Before Test Method Errored (PHPUnit\TestFixture\Event\SkippedInSetupTest::setUp)
2524
Before Test Method Finished:
2625
- PHPUnit\TestFixture\Event\SkippedInSetupTest::setUp
2726
Test Skipped (PHPUnit\TestFixture\Event\SkippedInSetupTest::testOne)

0 commit comments

Comments
 (0)