Skip to content

Commit

Permalink
Hook on finished instead of passed test event
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored and localheinz committed Dec 1, 2023
1 parent 8a8c2bd commit 15c3c4d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"int",
"null",
"PHPUnit\\Event\\Code\\Test",
"PHPUnit\\Event\\Test\\Passed",
"PHPUnit\\Event\\Test\\PassedSubscriber",
"PHPUnit\\Event\\Test\\Finished",
"PHPUnit\\Event\\Test\\FinishedSubscriber",
"PHPUnit\\Event\\Test\\Prepared",
"PHPUnit\\Event\\Test\\PreparedSubscriber",
"PHPUnit\\Event\\TestRunner\\ExecutionFinished",
Expand Down
6 changes: 3 additions & 3 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<code>($durationInMilliseconds - $hoursInMilliseconds - $minutesInMilliseconds) / 1_000</code>
</InvalidOperand>
</file>
<file src="src/Subscriber/TestPassedSubscriber.php">
<file src="src/Subscriber/TestFinishedSubscriber.php">
<UndefinedClass>
<code>Event\Test\PassedSubscriber</code>
<code>Event\Test\FinishedSubscriber</code>
</UndefinedClass>
<UnusedClass>
<code>TestPassedSubscriber</code>
<code>TestFinishedSubscriber</code>
</UnusedClass>
<UnusedParam>
<code>$collector</code>
Expand Down
6 changes: 3 additions & 3 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function bootstrap(

$facade->registerSubscribers(
new Subscriber\TestPreparedSubscriber($timeKeeper),
new Subscriber\TestPassedSubscriber(
new Subscriber\TestFinishedSubscriber(

Check warning on line 66 in src/Extension.php

View check run for this annotation

Codecov / codecov/patch

src/Extension.php#L66

Added line #L66 was not covered by tests
$maximumDuration,
$timeKeeper,
$collector,
Expand All @@ -81,7 +81,7 @@ public function bootstrap(
*/
final class Extension implements
Runner\AfterLastTestHook,
Runner\AfterSuccessfulTestHook,
Runner\AfterTestHook,
Runner\BeforeFirstTestHook
{
private int $suites = 0;
Expand Down Expand Up @@ -117,7 +117,7 @@ public function executeBeforeFirstTest(): void
++$this->suites;
}

public function executeAfterSuccessfulTest(
public function executeAfterTest(

Check warning on line 120 in src/Extension.php

View check run for this annotation

Codecov / codecov/patch

src/Extension.php#L120

Added line #L120 was not covered by tests
string $test,
float $time
): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* @internal
*/
final class TestPassedSubscriber implements Event\Test\PassedSubscriber
final class TestFinishedSubscriber implements Event\Test\FinishedSubscriber
{
private Collector\Collector $collector;
private TimeKeeper $timeKeeper;
Expand All @@ -42,7 +42,7 @@ public function __construct(
$this->collector = $collector;
}

public function notify(Event\Test\Passed $event): void
public function notify(Event\Test\Finished $event): void
{
$testIdentifier = TestIdentifier::fromString($event->test()->id());

Expand Down

0 comments on commit 15c3c4d

Please sign in to comment.