giorgiosironi/eris
Eris brings QuickCheck-style property-based testing to PHP and PHPUnit. Define properties, generate many random inputs, and find minimal counterexamples automatically. Works with PHP 8.1–8.4 and PHPUnit 10–13.
Adopt if:
Look elsewhere if:
"Eris lets us automatically find bugs we’d miss with manual testing—like a stress test for our code. For example, if we’re processing payments, Eris can generate thousands of edge cases (e.g., fractional cents, malformed dates) to ensure our logic never fails in production. This reduces costly post-launch fixes and builds confidence in our systems. It’s like having a bug-hunting AI for our PHP codebase, with minimal upfront effort."
ROI:
"Eris brings property-based testing (PBT) to PHP, inspired by Haskell’s QuickCheck. Instead of writing one test per edge case, we define invariants (e.g., ‘all user IDs must be positive integers’) and let Eris generate inputs to break them. When it finds a failure, it shrinks the input to the simplest case that still breaks the code—saving us hours of debugging.
Key Benefits:
Getting Started:
composer require --dev giorgiosironi/eris.$this->assertTrue(is_int($userId));
With a property-based test:
$this->forAll(Generators::nat())->then(fn($id) => $this->assertTrue(is_int($id)));
$id that fails—often revealing a hidden bug in our logic.Trade-offs:
Proposal: Pilot Eris on one high-risk module (e.g., payment processing) to measure bug detection improvements."*
How can I help you explore Laravel packages today?