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

Assume

Rasuvaeff\PropertyTesting\Assume

ClassSource

Discard a property run when a precondition does not hold.

An attempt discarded via Assume::that() is neither a failure nor a successful check: the property runner retries with another random input. Use it to skip combinations of generated values that are out of the property's domain (e.g. "cap must be >= baseSeconds") instead of rejecting them with a narrow Gen::filter(), which is slower.

Discards do not consume Property::$runs. The runner warns when more than 90% of attempts are discarded and fails with GaveUpException when Property::$maxDiscards is exceeded.

Methods

that()

php
static that(bool $condition): void

Discard the current run unless the condition is true.