Skip to content

ExampleViolationException

Rasuvaeff\PropertyTesting\ExampleViolationException

ClassPackage: property-testing-coreSourceVersion: v0.1.0-12-g86ead85

Extends: RuntimeException

Implements: Stringable, Throwable

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