PathViolationException
Rasuvaeff\PropertyTesting\PathViolationException
Class — Package: property-testing-core — Source — Version: v1.0.0-1-g88fdee2
Extends: RuntimeException
Implements: Throwable, Stringable, PropertyTestingException
Reported when a run pinned to a shrink path cannot follow it: the candidate a step names is gone, no longer differs from the value it would replace, or no longer falsifies the property.
A path indexes into each node's shrink candidates, so any edit to a generator — even reordering the candidates of one — orphans it. That is the expected end of a path's life, and it is reported rather than absorbed: had the runner fallen back to a fresh search, the answer would look exactly like a successful replay while reproducing a different descent.
The property still failed when this is raised; what failed is the reproduction, not the property. For a regression that has to survive a refactor, record it in the corpus instead.
Constructor
__construct(
string $path,
int $step,
string $segment,
string $reason,
)| Parameter | Type | Default | Description |
|---|---|---|---|
$path | string | required | The path the run was pinned to. |
$step | int | required | One-based position of the segment that could not be followed. |
$segment | string | required | The segment itself, in its name:index form. |
$reason | string | required | Why it could not be followed, as a noun phrase. |
Methods
getPath()
getPath(): stringThe path the run was pinned to, as it was configured.
getStep()
getStep(): intOne-based position of the segment that could not be followed.
getSegment()
getSegment(): stringThe segment that could not be followed, in its name:index form.