Skip to content

PropertyResult

Rasuvaeff\PropertyTesting\Runner\PropertyResult

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

Implemented by: Runner\CoverageFailed, Runner\DeadlineExceeded, Runner\ExampleFailed, Runner\Falsified, Runner\GaveUp, Runner\GenerationFailed, Runner\Passed, Runner\RegressionFailed, Runner\TimeBudgetExceeded

Structured outcome of a property run. The runner returns a result — it never throws for a property outcome, exits, or prints; how a failure surfaces (a Testo TestResult, a PHPUnit assertion error, an exit code) is the adapter's decision.

The hierarchy is closed by construction: one class per outcome, so impossible data combinations are not representable. Configuration errors (invalid runs, a missing generator) remain exceptions — they are programmer errors, not verdicts about the property.

Serialization contract: the engine adds no unserializable state of its own, so every result survives native serialize() when captured stack traces carry no argument values (zend.exception_ignore_args=1). With argument capture enabled a failing result's trace may hold closures (the executor's body among them) and native serialization becomes environment-dependent; the portable machine format is CounterExample::toArray().

Methods

failure()

php
failure(): ?Throwable

The engine exception describing the failure — the same type and message the package has always reported (PropertyViolationException for a falsification, and so on). Null for a pass.