This commit is contained in:
nuno maduro
2026-04-22 08:42:32 -07:00
parent 68527c996f
commit 660b57b365
7 changed files with 215 additions and 30 deletions

View File

@ -8,6 +8,7 @@ use Composer\XdebugHandler\XdebugHandler;
use Pest\Plugins\Tia;
use Pest\Plugins\Tia\Fingerprint;
use Pest\Plugins\Tia\Graph;
use Pest\Plugins\Tia\Storage;
/**
* Re-execs the PHP process without Xdebug on TIA replay runs, matching the
@ -140,7 +141,7 @@ final class XdebugGuard
*/
private static function tiaWillReplay(string $projectRoot): bool
{
$path = self::graphPath();
$path = self::graphPath($projectRoot);
if (! is_file($path)) {
return false;
@ -165,15 +166,13 @@ final class XdebugGuard
}
/**
* On-disk location of the TIA graph — mirrors `Bootstrapper::tempDir()`
* so both writer and reader stay in sync without a runtime container
* lookup (the container isn't booted yet at this point).
* On-disk location of the TIA graph — delegates to {@see Storage} so
* the writer (TIA's bootstrapper) and this reader stay in sync
* without a runtime container lookup (the container isn't booted yet
* at this point).
*/
private static function graphPath(): string
private static function graphPath(string $projectRoot): string
{
return dirname(__DIR__, 2)
.DIRECTORY_SEPARATOR.'.temp'
.DIRECTORY_SEPARATOR.'tia'
.DIRECTORY_SEPARATOR.Tia::KEY_GRAPH;
return Storage::tempDir($projectRoot).DIRECTORY_SEPARATOR.Tia::KEY_GRAPH;
}
}