feat(tia): continues to work on poc

This commit is contained in:
nuno maduro
2026-04-16 14:24:20 -07:00
parent 42d1092a9e
commit 9c8033d60c
17 changed files with 301 additions and 172 deletions

View File

@ -14,7 +14,7 @@ namespace Pest\Plugins\Tia;
final class ResultCollector
{
/**
* @var array<string, array{status: int, message: string, time: float}>
* @var array<string, array{status: int, message: string, time: float, assertions: int}>
*/
private array $results = [];
@ -83,13 +83,20 @@ final class ResultCollector
}
/**
* @return array<string, array{status: int, message: string, time: float}>
* @return array<string, array{status: int, message: string, time: float, assertions: int}>
*/
public function all(): array
{
return $this->results;
}
public function recordAssertions(string $testId, int $assertions): void
{
if (isset($this->results[$testId])) {
$this->results[$testId]['assertions'] = $assertions;
}
}
public function reset(): void
{
$this->results = [];
@ -111,6 +118,7 @@ final class ResultCollector
'status' => $status,
'message' => $message,
'time' => $time,
'assertions' => 0,
];
$this->currentTestId = null;