Files
pest/tests-tia/RebuildTest.php
nuno maduro d9c18f9c02 wip
2026-04-22 09:03:10 -07:00

29 lines
849 B
PHP

<?php
declare(strict_types=1);
use Pest\TestsTia\Support\Sandbox;
/*
* `--tia --fresh` short-circuits whatever graph is on disk and records
* from scratch. Used when the user knows the cache is wrong.
*/
test('--tia --fresh forces record mode even with a valid graph', function () {
tiaScenario(function (Sandbox $sandbox) {
$sandbox->pest(['--tia']);
expect($sandbox->hasGraph())->toBeTrue();
$graphBefore = $sandbox->graph();
$process = $sandbox->pest(['--tia', '--fresh']);
expect($process->isSuccessful())->toBeTrue(tiaOutput($process));
expect(tiaOutput($process))->toContain('recording dependency graph');
$graphAfter = $sandbox->graph();
expect(array_keys($graphAfter['edges']))
->toEqualCanonicalizing(array_keys($graphBefore['edges']));
});
});