Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eris Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Shift from traditional unit testing to property-based testing (PBT):

    • Enable teams to validate complex invariants (e.g., "all edge cases in a payment calculation") rather than just predefined inputs.
    • Reduce flakiness by automatically generating diverse test inputs, including edge cases.
  • Quality gates for critical logic:

    • Integrate PBT into CI pipelines for high-risk components (e.g., billing, authentication, data transformations).
    • Example: Validate that a discount calculation never produces negative values across 10,000+ random inputs.
  • Build vs. buy:

    • Buy: Adopt Eris to avoid reinventing PBT infrastructure (generators, shrinking, assertions).
    • Build: Only if needing custom generators (e.g., domain-specific data models) beyond Eris’s scope.
  • Use cases:

    • Data pipelines: Verify transformations (e.g., "no nulls in output after mapping").
    • Math/algorithms: Test correctness of sorting, hashing, or cryptographic functions.
    • API contracts: Ensure responses adhere to schemas (e.g., "all timestamps are ISO-8601").
    • Edge-case hunting: Automatically stress-test parsers, validators, or serializers.

When to Consider This Package

Adopt Eris if:

  • Your team uses PHPUnit and needs automated test input generation beyond manual test cases.
  • You have complex invariants to validate (e.g., "this function must always return a positive integer").
  • You want reproducible, shrunk counterexamples when tests fail (e.g., "the smallest input that breaks this parser").
  • Your stack supports PHP 8.1+ and PHPUnit 10+ (no legacy constraints).
  • You’re willing to refactor tests to use Eris’s forAll/then syntax (not a drop-in replacement).

Look elsewhere if:

  • You need GUI-based testing tools (e.g., Selenium for UI).
  • Your tests are performance-critical (Eris adds overhead; use traditional unit tests instead).
  • You require custom domain models (e.g., generating complex nested objects) and Eris’s generators are insufficient.
  • Your team lacks buy-in for property-based testing (requires cultural shift from "test specific cases" to "test properties").
  • You’re using HHVM or PHP < 8.1 (unsupported).

How to Pitch It (Stakeholders)

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:

  • Automatic test input generation: No more guessing edge cases.
  • Shrinking: When a test fails, Eris finds the smallest input that breaks it, saving debugging time.
  • Seamless PHPUnit integration: Uses familiar syntax ($this->assertTrue()) with forAll()/then().
  • Generators for everything: Integers, strings, dates, regex patterns, nested objects, etc. Example:
$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:

  • Faster debugging: Shrinking reduces noise in failures.
  • Higher confidence: Tests cover more edge cases with less manual effort.
  • CI-friendly: Runs alongside existing PHPUnit tests. Tradeoff: Requires rewriting some tests to use forAll instead of hardcoded inputs. Worth it for critical paths."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai