TestBaselineHandler
Records a test baseline and reports the delta against it, so a regression can be told apart from a failure that was already there. The `test` operation already answers "does the suite pass right now" ({@see TestHandler}). What it cannot answer is "did MY change break this" — a red suite looks the same whether the failure is new or pre-existing, and "it already failed" stays an unverifiable claim. This handler closes that gap: `test:baseline` snapshots which tests pass and fail, and `test:delta` runs again and names the new, resolved, and unchanged failures against that snapshot. Like {@see TestHandler} it runs the suite in a real subprocess (running PHPUnit inside PHPUnit is a recursion nobody wants to debug) via an injected {@see ProcessRunner} seam, and reads per-test identity from PHPUnit's JUnit log rather than the human summary, because counts cannot distinguish one broken test from another.
TestBaselineHandler::__construct()
public function __construct(Milpa\DevTools\Support\RootResolver $roots = new RootResolver(), Milpa\DevTools\Support\ProcessRunner $runner = new ProcessRunner(), Milpa\DevTools\Test\JUnitParser $parser = new JUnitParser(), Milpa\DevTools\Test\TestDelta $delta = new TestDelta()):Parameters
| Name | Type | Description |
|---|---|---|
| $roots | Milpa\DevTools\Support\RootResolver | |
| $runner | Milpa\DevTools\Support\ProcessRunner | |
| $parser | Milpa\DevTools\Test\JUnitParser | |
| $delta | Milpa\DevTools\Test\TestDelta |
TestBaselineHandler::handleBaseline()
public function handleBaseline(array $input): arrayRuns the suite and records which tests passed and failed as the baseline to compare against later.
Parameters
| Name | Type | Description |
|---|---|---|
| $input | array<string, mixed> |
TestBaselineHandler::handleDelta()
public function handleDelta(array $input): arrayRuns the suite again and reports the new, resolved, and unchanged failures against the baseline.
Parameters
| Name | Type | Description |
|---|---|---|
| $input | array<string, mixed> |