Skip to content

RandomEngineArbitrary ​

Rasuvaeff\PropertyTesting\Arbitrary\RandomEngineArbitrary

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

Implements: ArbitraryInterface

Yields a DrawnEngine. The engine draws nothing at generation time — its randomness is consumed by the body, through the draw tape — so the node is a leaf: what shrinks is the tape, as draw#N pseudo-arguments.

Methods ​

generate() ​

php
generate(\Random $random): Shrinkable

Produce one random value from this arbitrary's space, together with its shrink tree. Candidates must be ordered most aggressive first (typically toward a zero/empty/identity element) and every branch of the tree must be finite, so shrinking terminates.

Documentation inherited from ArbitraryInterface.

  • $random — The run's stream; unused — the engine draws at body time, through the tape.