Skip to content

PostconditionViolationException ​

Rasuvaeff\PropertyTesting\StateMachine\PostconditionViolationException

Class — Package: property-testing-core — Source — Version: v1.0.0-1-g88fdee2

Extends: RuntimeException

Implements: Throwable, Stringable, PropertyTestingException

Thrown by StateMachine::check() when a command's Command::postCondition() returns false.

Carries the executed trace (command labels up to and including the failing one), the failing command, and the pre-state model and observed result, so the property runner surfaces exactly which step of the sequence broke.

Constructor ​

php
__construct(
    list<string> $trace,
    int $step,
    StateMachine\Command $command,
    mixed $model,
    mixed $result,
)
ParameterTypeDefaultDescription
$tracelist<string>requiredLabels of the commands executed up to and including the failing one.
$stepintrequired
$commandStateMachine\Commandrequired
$modelmixedrequired
$resultmixedrequired