Weave 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

Phpunit Matrix Data Provider Laravel Package

apie/phpunit-matrix-data-provider

PHPUnit data provider that generates a matrix of test cases across multiple PHP and Laravel versions in one go. Configure your supported version combinations and let it fan tests out automatically, keeping compatibility suites DRY and every run clearly labeled by environment.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Test-matrix coverage decisions: When a feature has several independent dimensions (e.g. payment provider × currency × locale × shipping tier × customer segment), this package lets the team express "test every combination" declaratively. That directly informs whether a release is safe to ship across the full configuration surface, not just the happy path.
  • Build vs. buy (vs. copy) for test tooling: The package is a ~single-purpose Cartesian-product data provider. The real decision it surfaces is whether test-infrastructure utilities should be pulled from Packagist at all, or vendored as a small internal helper. Its existence is a useful reference implementation, even if the answer is "write our own 20-line provider."
  • Roadmap scoping for combinatorial risk: If the product roadmap adds new axes (a new region, a new payment method, a new plan tier), the combinatorial explosion becomes a roadmap risk. A matrix provider makes that cost visible early — 4 × 5 × 3 × 2 = 120 cases is a budget conversation, not a QA surprise.
  • Regression-suite strategy: Supports decisions about pairwise vs. full-factorial testing. If full combinations are cheap enough to run in CI, you can justify skipping a combinatorial reduction tool; if not, this package helps you measure the blow-up before committing.
  • Use cases worth naming: pricing/promo eligibility matrices, tax and billing-address permutations, permission/role × resource × action authorization tables, feature-flag combinations, serialization/format compatibility, and API version × client-version support windows.
  • Not a product differentiator: This is internal engineering leverage. It should be evaluated as a productivity/quality investment, not as a customer-facing capability, and it should never appear on a customer roadmap.

When to Consider This Package

Consider it when all of the following hold:

  • Your stack is PHP / Laravel with PHPUnit and tests already use data providers idiomatically.
  • You have two or more genuinely independent input dimensions per test and the correctness bug you fear lives at the intersection, not in any single dimension.
  • The combination count is bounded and known (dozens to a few hundred), so full-factorial testing fits a CI budget.
  • You want the matrix declared inline in the test, readable by a reviewer, with no external fixture files or config DSL.
  • You are comfortable treating it as a throwaway utility — the risk profile of a 0-star, 0-dependent, single-maintainer package is high, so you must be willing to fork or reimplement it in an afternoon. Vendoring the source into a tests/Support directory is a legitimate adoption path.

Look elsewhere — or write it yourself — when:

  • You need pairwise / orthogonal-array reduction (all-pairs) rather than full Cartesian product; this package does not solve the explosion problem, it creates it.
  • Combinations run into the thousands, where you need sharding, parallelization, or a test-selection/orchestration tool instead.
  • You are on Pest, or on PHPUnit versions where data-provider semantics differ; the package targets a specific PHPUnit data-provider contract and 0 stars means no community pressure to keep pace with PHPUnit majors.
  • You need maintained, supported, or audited dependencies — no releases cadence, no issue history, no security posture to point at.
  • The matrix is really a table of named scenarios with expected outcomes. A hand-written named-cases provider documents intent better than a blind product; generated combinations obscure why a case exists.
  • Your team already has a base test case or trait that generates combinations; adding a dependency for the same behavior is net negative.

Practical caveat for the pitch: the value here is the pattern, not the package. Any competent PHP engineer can produce the same behavior with a nested foreach and a generator in well under an hour, and that version has zero supply-chain risk and can be typed and documented to your standards.

How to Pitch It (Stakeholders)

For executives: This is a small, free (MIT) testing utility that lets our engineers verify a feature works across every combination of its settings, rather than a hand-picked few. For products with configurable dimensions — regions, currencies, plans, payment methods, permission levels — that is where expensive production bugs hide. The cost is effectively zero and the effort is measured in hours. The caveat is equally small: the package is a single-purpose helper with no adoption and no maintenance guarantees, so we would copy its approach into our own codebase rather than depend on it long-term. Recommend: adopt the pattern internally, do not add it as a supported dependency.

For engineering leadership: It removes boilerplate around PHPUnit data providers when you need a full Cartesian product of input dimensions. It is roughly a one-function library; we can vendor it into tests/Support or reimplement it with a typed generator in an afternoon, which eliminates the 0-star supply-chain and PHPUnit-version-compatibility risk entirely. Pair it with a conversation about pairwise reduction once any single matrix crosses ~200 cases, because full-factorial growth is the failure mode.

For the engineering team: Use it (or our copy of it) where the interaction between parameters is the risk — pricing rules, authorization tables, tax permutations, feature-flag combinations. Do not use it to enumerate scenarios that deserve individual names and individual assertions; a generated matrix tells you something broke but not what the case was supposed to prove. Keep each matrix under a few hundred cases, keep the dimension arrays readable, and give the resulting test a name that states the invariant being defended.

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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core