giorgiosironi/eris
Eris brings QuickCheck-style property-based testing to PHP and PHPUnit. Define properties and Eris generates hundreds of random inputs to break them, shrinking failures to minimal counterexamples. Install via Composer as a dev dependency; supports PHP 8.1+ and PHPUnit 10-13.
regex() accepts a $random argument (srand, mersenne or simple) to choose the reverse-regex random generator, simple by default.regex() accepts an $unboundedMax argument to configure the maximum number of repetitions of * and + (requires ilario-pierbattista/reverse-regex ^0.7.0) (#217).ilario-pierbattista/reverse-regex ^0.8.0, alongside ^0.7.0 (#218).regex() no longer throws a ReverseRegex\Exception on patterns with unbounded quantifiers such as * and +: they are now bounded by reverse-regex (#193).Generator\set() chooses the size of the set with the configured random source instead of PHP's global rand(), so the generated sets are reproducible from the Eris seed regardless of other uses of the global RNG. Sets generated for a given seed differ from previous versions (#204), thanks @matthiasgoergens.#[ErisRepeat(repeat: 1)] or limitTo(1), no longer fails with a division by zero (#205), thanks @matthiasgoergens.icomefromthenet/reverse-regex dependency. Only ilario-pierbattista/reverse-regex is now supported for the regex() generator (other forks are welcome).oneOf check failure with PSalmilario-pierbattista/reverse-regex as substitute peer dependency of icomefromthenet/reverse-regex.Eris\Generators contains all the generator constructors as static methods.Eris\Generators. They will be deprecated.shrink() to receive GeneratedValueOptions (#127).sample() (#128)BooleanGenerator::shrink() to return a GeneratedValueSingle (#131)How can I help you explore Laravel packages today?