mirror of
https://github.com/pestphp/pest.git
synced 2026-06-05 02:52:12 +02:00
34 lines
650 B
PHP
34 lines
650 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pest\Plugins\Tia;
|
|
|
|
use PHPUnit\Framework\TestStatus\TestStatus;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
enum Replay
|
|
{
|
|
case No;
|
|
case Pass;
|
|
case Skipped;
|
|
case Incomplete;
|
|
case Failure;
|
|
|
|
public static function fromStatus(?TestStatus $status): self
|
|
{
|
|
if (! $status instanceof TestStatus) {
|
|
return self::No;
|
|
}
|
|
|
|
return match (true) {
|
|
$status->isSuccess(), $status->isRisky() => self::Pass,
|
|
$status->isSkipped() => self::Skipped,
|
|
$status->isIncomplete() => self::Incomplete,
|
|
default => self::Failure,
|
|
};
|
|
}
|
|
}
|