mirror of
https://github.com/pestphp/pest.git
synced 2026-06-07 11:52:13 +02:00
wip
This commit is contained in:
@ -11,17 +11,22 @@ use PHPUnit\Framework\TestStatus\TestStatus;
|
||||
*/
|
||||
enum Replay
|
||||
{
|
||||
case No;
|
||||
case Pass;
|
||||
case Skipped;
|
||||
case Incomplete;
|
||||
case Failure;
|
||||
|
||||
public static function from(TestStatus $cached): self
|
||||
public static function fromStatus(?TestStatus $status): self
|
||||
{
|
||||
if (! $status instanceof TestStatus) {
|
||||
return self::No;
|
||||
}
|
||||
|
||||
return match (true) {
|
||||
$cached->isSuccess(), $cached->isRisky() => self::Pass,
|
||||
$cached->isSkipped() => self::Skipped,
|
||||
$cached->isIncomplete() => self::Incomplete,
|
||||
$status->isSuccess(), $status->isRisky() => self::Pass,
|
||||
$status->isSkipped() => self::Skipped,
|
||||
$status->isIncomplete() => self::Incomplete,
|
||||
default => self::Failure,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user