Skip to content

BoolArbitrary ​

Rasuvaeff\PropertyTesting\Arbitrary\BoolArbitrary

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

Implements: Enumerable, ArbitraryInterface

Generates booleans. false is the "smaller" boolean: true shrinks to false, false is terminal.

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.

domainSize() ​

php
domainSize(): int

How many distinct values enumerate() walks, or null when the domain is not finite in this configuration. Saturates at PHP_INT_MAX rather than overflowing — a budget compares against it, nothing computes with it. An upper bound is acceptable where the exact count is not known without walking (a filter over a finite source).

Documentation inherited from Enumerable.

enumerate() ​

php
enumerate(): iterable

Every value of the domain, once each, as a shrinkable node with the same tree generate() would give it, in a fixed order that does not depend on any seed. Only meaningful when domainSize() is not null; an implementation may throw otherwise.

Documentation inherited from Enumerable.