|
16 | 16 | use PHPUnit\Event\Code\TestMethod; |
17 | 17 | use PHPUnit\Event\EventFacadeIsSealedException; |
18 | 18 | use PHPUnit\Event\Facade; |
| 19 | +use PHPUnit\Event\Test\AfterLastTestMethodErrored; |
19 | 20 | use PHPUnit\Event\Test\BeforeFirstTestMethodErrored; |
20 | 21 | use PHPUnit\Event\Test\ConsideredRisky; |
21 | 22 | use PHPUnit\Event\Test\DeprecationTriggered; |
@@ -66,7 +67,7 @@ final class Collector |
66 | 67 | private int $numberOfIssuesIgnoredByBaseline = 0; |
67 | 68 |
|
68 | 69 | /** |
69 | | - * @psalm-var list<BeforeFirstTestMethodErrored|Errored> |
| 70 | + * @psalm-var list<AfterLastTestMethodErrored|BeforeFirstTestMethodErrored|Errored> |
70 | 71 | */ |
71 | 72 | private array $testErroredEvents = []; |
72 | 73 |
|
@@ -169,6 +170,7 @@ public function __construct(Facade $facade, Source $source) |
169 | 170 | new TestPreparedSubscriber($this), |
170 | 171 | new TestFinishedSubscriber($this), |
171 | 172 | new BeforeTestClassMethodErroredSubscriber($this), |
| 173 | + new AfterTestClassMethodErroredSubscriber($this), |
172 | 174 | new TestErroredSubscriber($this), |
173 | 175 | new TestFailedSubscriber($this), |
174 | 176 | new TestMarkedIncompleteSubscriber($this), |
@@ -296,6 +298,11 @@ public function beforeTestClassMethodErrored(BeforeFirstTestMethodErrored $event |
296 | 298 | $this->numberOfTestsRun++; |
297 | 299 | } |
298 | 300 |
|
| 301 | + public function afterTestClassMethodErrored(AfterLastTestMethodErrored $event): void |
| 302 | + { |
| 303 | + $this->testErroredEvents[] = $event; |
| 304 | + } |
| 305 | + |
299 | 306 | public function testErrored(Errored $event): void |
300 | 307 | { |
301 | 308 | $this->testErroredEvents[] = $event; |
|
0 commit comments