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 committed Dec 3, 2023
1 parent c101046 commit e910fd3
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 @@ -21,12 +21,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 @@ -35,7 +35,7 @@
*/
final class Extension implements
Runner\AfterLastTestHook,
Runner\AfterSuccessfulTestHook,
Runner\AfterTestHook,

Check warning on line 38 in src/Extension.php

View check run for this annotation

Codecov / codecov/patch

src/Extension.php#L38

Added line #L38 was not covered by tests
Runner\BeforeFirstTestHook
{
private int $suites = 0;
Expand Down Expand Up @@ -71,7 +71,7 @@ public function executeBeforeFirstTest(): void
++$this->suites;
}

public function executeAfterSuccessfulTest(
public function executeAfterTest(
string $test,
float $time
): void {
Expand Down Expand Up @@ -210,7 +210,7 @@ public function bootstrap(

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

Check warning on line 213 in src/Extension.php

View check run for this annotation

Codecov / codecov/patch

src/Extension.php#L213

Added line #L213 was not covered by tests
$maximumDuration,
$timeKeeper,
$collector,
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 e910fd3

Please sign in to comment.