Skip to content

ExampleViolationException ​

Rasuvaeff\PropertyTesting\ExampleViolationException

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

Extends: RuntimeException

Implements: Throwable, Stringable, PropertyTestingException

Reported when an explicit example (a fixed input declared via the property's Examples method) fails. Examples run before the random inputs and are not shrunk — they are already the minimal case the developer pinned — so this carries the example's index and arguments verbatim.

Constructor ​

php
__construct(
    int $index,
    list $arguments,
    ?\Throwable $failure = NULL,
)
ParameterTypeDefaultDescription
$indexintrequiredZero-based position of the failing example.
$argumentslistrequiredThe example's positional arguments.
$failure?\ThrowableNULLThe assertion or exception the example raised.

Methods ​

getIndex() ​

php
getIndex(): int

getArguments() ​

php
getArguments(): array