mirror of
https://github.com/pestphp/pest.git
synced 2026-06-05 10:52:14 +02:00
wip
This commit is contained in:
@ -144,6 +144,32 @@ final class Recorder
|
||||
$this->currentTestFile = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Records an extra source-file dependency for the currently-running
|
||||
* test. Used by collaborators that capture edges the coverage driver
|
||||
* cannot see — Blade templates rendered through Laravel's view
|
||||
* factory are the motivating case (their `.blade.php` source never
|
||||
* executes directly; a cached compiled PHP file does). No-op when
|
||||
* the recorder is inactive or no test is in flight, so callers can
|
||||
* fire it unconditionally from app-level hooks.
|
||||
*/
|
||||
public function linkSource(string $sourceFile): void
|
||||
{
|
||||
if (! $this->active) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->currentTestFile === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($sourceFile === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->perTestFiles[$this->currentTestFile][$sourceFile] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>> absolute test file → list of absolute source files.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user