giorgiosironi/eris
Eris brings QuickCheck-style property-based testing to PHP and PHPUnit. Define properties, generate many randomized inputs, and let Eris shrink failing cases to minimal counterexamples. Works with PHP 8.1+ and PHPUnit 10–13 via a simple TestTrait.
Shift from traditional unit testing to property-based testing (PBT):
Quality gates for critical logic:
Build vs. buy:
Use cases:
Adopt Eris if:
forAll/then syntax (not a drop-in replacement).Look elsewhere if:
For Executives: "Eris lets us automatically find bugs we’d never think to test manually—like edge cases in payment logic or data transformations. Instead of writing 100 test cases for a function, we define one rule (e.g., ‘output must always be positive’) and let Eris generate 10,000 inputs to verify it. This catches regressions early and reduces flaky tests. For example, at [Company], we used it to find a $50K/year billing error hidden in discount calculations. It’s a force multiplier for QA—like having a team of testers working 24/7 to stress-test our code."
For Engineering: *"Eris brings property-based testing (PBT) to PHP, inspired by Haskell’s QuickCheck. Key benefits:
$this->assertTrue()) with forAll()/then().$this->forAll(Generators::choose(0, 1_000_000))
->then(fn(int $amount) => $this->assertTrue(
$this->calculateDiscount($amount) >= 0,
"Discount can't be negative for \$amount"
));
Impact:
forAll instead of hardcoded inputs. Worth it for critical paths."*How can I help you explore Laravel packages today?