This commit is contained in:
nuno maduro
2026-05-01 21:22:33 +01:00
parent b2c07561e7
commit 6e0e030d71
4 changed files with 24 additions and 205 deletions

View File

@ -276,14 +276,18 @@ trait Testable
/** @var Tia $tia */
$tia = Container::getInstance()->get(Tia::class);
$cached = $tia->getCachedResult(self::$__filename, $this::class.'::'.$this->name());
$status = $tia->getStatus(self::$__filename, $this::class.'::'.$this->name());
$replay = Replay::fromStatus($status);
if ($cached !== null) {
match (Replay::from($cached)) {
if ($replay !== Replay::No) {
assert($status !== null);
match ($replay) {
Replay::Pass => $this->__shortCircuitCachedPass(),
Replay::Skipped => $this->markTestSkipped($cached->message()),
Replay::Incomplete => $this->markTestIncomplete($cached->message()),
Replay::Failure => throw new AssertionFailedError($cached->message() ?: 'Cached failure'),
Replay::Skipped => $this->markTestSkipped($status->message()),
Replay::Incomplete => $this->markTestIncomplete($status->message()),
Replay::Failure => throw new AssertionFailedError($status->message() ?: 'Cached failure'),
Replay::No => null,
};
return;