-
Notifications
You must be signed in to change notification settings - Fork 62
Enhancement: Update extension to use event system of phpunit/phpunit:10.0.0
#98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ | |
} | ||
], | ||
"require": { | ||
"php": ">=7.2", | ||
"phpunit/phpunit": "^8.0 || ^9.0" | ||
"php": "^8.1", | ||
"phpunit/phpunit": "^10.0.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how feasible is to keep currently still supported phpunit 9.x together with 10.x? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @localheinz can it be done, please, so this dep can be used for projects that still need PHP <8.1 support |
||
}, | ||
"extra": { | ||
"branch-alias": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JohnKary\PHPUnit\Extension; | ||
|
||
use PHPUnit\Event; | ||
|
||
final class PreparedTest | ||
{ | ||
public function __construct( | ||
private readonly Event\Code\Test $test, | ||
private readonly Event\Telemetry\HRTime $start | ||
) { | ||
} | ||
|
||
public function test(): Event\Code\Test | ||
{ | ||
return $this->test; | ||
} | ||
|
||
public function start(): Event\Telemetry\HRTime | ||
{ | ||
return $this->start; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JohnKary\PHPUnit\Extension; | ||
|
||
use PHPUnit\Event; | ||
|
||
final class RecordThatTestHasBeenPrepared implements Event\Test\PreparedSubscriber | ||
{ | ||
public function __construct(private readonly SpeedTrap $speedTrap) | ||
{ | ||
} | ||
|
||
public function notify(Event\Test\Prepared $event): void | ||
{ | ||
$this->speedTrap->recordThatTestHasBeenPrepared( | ||
$event->test(), | ||
$event->telemetryInfo()->time(), | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JohnKary\PHPUnit\Extension; | ||
|
||
use PHPUnit\Event; | ||
|
||
final class RecordThatTestHasPassed implements Event\Test\PassedSubscriber | ||
{ | ||
public function __construct(private readonly SpeedTrap $speedTrap) | ||
{ | ||
} | ||
|
||
public function notify(Event\Test\Passed $event): void | ||
{ | ||
$this->speedTrap->recordThatTestHasPassed( | ||
$event->test(), | ||
$event->telemetryInfo()->time(), | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JohnKary\PHPUnit\Extension; | ||
|
||
use PHPUnit\Event; | ||
|
||
final class ShowSlowTests implements Event\TestRunner\ExecutionFinishedSubscriber | ||
{ | ||
public function __construct(private readonly SpeedTrap $speedTrap) | ||
{ | ||
} | ||
|
||
public function notify(Event\TestRunner\ExecutionFinished $event): void | ||
{ | ||
$this->speedTrap->showSlowTests(); | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.