These docs have moved. The package is frozen at 2.8.1; the current documentation lives on the family site, property-testing. If the redirect did not fire, open the migration guide.
Skip to content

CounterExample ​

Rasuvaeff\PropertyTesting\CounterExample

Class — Source

Minimal failing input for a property, captured at falsification time.

Carries both the original (randomly generated) counterexample and the shrunk (minimised) one, plus the seed needed to reproduce the run.

Properties ​

PropertyTypeReadonly
seedintyes
runsBeforeFailureintyes
originalArgumentsarrayyes
shrunkArgumentsarrayyes
shrinkStepsintyes
failure?Throwableyes
skipsintyes
shrinkTrialsintyes

Methods ​

toArray() ​

php
toArray(): array

Machine-readable representation suitable for reporters and serialization.

toJson() ​

php
toJson(bool $pretty): string

toExamplesCode() ​

php
toExamplesCode(string $methodName): string