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

Test Foundation Laravel Package

open-dxp/test-foundation

A testing foundation for Laravel packages, offering base test cases, helper traits, and sensible defaults that bootstrap PHPUnit or Pest suites quickly. It standardizes setup so package authors spend less time wiring scaffolding and more time writing assertions.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Scope is deliberately narrow: open-dxp/test-foundation is a dev-only test harness (Testbench/PHPUnit bootstrapping, PSR-4 helper/fixture traits, Pest expectations, transactional isolation, an EnvironmentTestCase with a config/test.yaml overlay). It sits in require-dev and touches no runtime path.
  • The opinionated layer is the actual product. The value is not the helpers — those are ~200 lines any senior dev writes — it is the encoded convention set (one action per test, no pre-action assertions, datasets over loops, factories over raw values, tests/Value/ shapes, named doubles in tests/Application/). That is a genuine architectural asset: it makes a multi-repo suite uniform and machine-checkable.
  • The skills/opendxp-tests/SKILL.md artifact signals the package is designed as much for coding agents as for humans. That is the most interesting and least validated part of the design.
  • Fit is strongest if you are inside the OpenDXP/Pimcore lineage or run many small Laravel packages. Fit is weak if you are a single Laravel application on stock Tests\TestCase + RefreshDatabase + Dusk, where most of the bootstrapping is redundant.

Integration feasibility

  • Technically low-effort: install as dev dependency, extend the provided base cases or compose traits, add one YAML file. No migrations, no service providers in the request path, no data model assumptions visible from the docs.
  • The hard dependency risk is Pest. The convention set is written in Pest idioms (expect()->and(), ->throws(), self::faker(), custom expectations). A PHPUnit-only house style makes this package a partial fit at best.
  • Testbench-based bootstrapping is excellent for package development and awkward for application tests; both are claimed, so verify which story is actually supported before committing.

Technical risk

  • Blast radius is contained: test-only code cannot cause a production outage. The exposure is CI determinism, developer velocity, and false confidence in coverage.
  • Adoption risk is high and concentrated in the supply chain: 1 star, 0 dependents, effectively no external validation. Bus factor is the vendor team. A single-repo project cannot lean on community answers.
  • Coupling risk: fixtures/helpers aimed at DXP domain objects (documents, objects, parents, publication states) will not port to a generic Laravel codebase, and will lock fixture semantics to vendor model APIs.
  • Global-state risk: Pest expectation extensions register process-wide. Two packages extending the same expectation name produce order-dependent failures that are painful to diagnose.
  • Isolation risk: the transaction-per-test guarantee does not hold for MySQL DDL (implicit commit), multi-connection tests, queue/HTTP fakes touching real storage, or browser tests. Silent leakage here is the most expensive failure mode.
  • Governance risk: an agent-readable convention file plus a generative workflow can produce structurally perfect, behaviourally shallow tests. The one-action rule mitigates but does not eliminate this.

Key questions

  1. What is the support matrix — Laravel versions, PHP versions, Pest 2 vs 3, Testbench majors — and what is the versioning/BC policy (is it pre-1.0)?
  2. Is the package a thin superset of Testbench's TestCase, or does it fork/override bootstrapping in ways that will conflict with future Testbench releases?
  3. Does the transactional isolation model work under ParaTest/parallel execution, and across multiple database connections?
  4. How does config/test.yaml interact with phpunit.xml, .env.testing, and per-test-case config imports — is there one authoritative config source or two?
  5. Are the named expectations namespaced or global, and what happens on a collision?
  6. Is the "OpenDXP testkit" container a hard requirement for running tests and static checks, or an optional convenience? Anything that forces Docker in CI needs a cost estimate.
  7. What is the vendor's commitment — roadmap, issue SLA, willingness to accept external PRs, license and CLA terms?
  8. Are the domain fixtures separable from the DXP domain model, so non-DXP packages can use the harness alone?

Integration Approach

Stack fit

  • Best fit: a portfolio of Laravel packages, a monorepo of DXP extensions, or a team already standardized on Pest + Testbench. Adopt wholesale.
  • Partial fit: a Pest application repo. Take the bootstrapping, isolation, and expectation conventions; skip the package-oriented Testbench layer.
  • Poor fit: a PHPUnit-only shop, a Dusk-heavy browser suite, or a single application with an established custom TestCase. Take the conventions document, not the dependency.

Migration path

  1. Harness first, conventions second. Land the dev dependency and the base test case behind a feature branch on one repository. Do not restyle existing tests.
  2. Coexistence, not cutover. PHPUnit assertions and Pest expectations can live side by side. Migrate assertions opportunistically when a file is already being edited; never as a standalone "convert the suite" project.
  3. Keep phpunit.xml authoritative. Use config/test.yaml only for the subset that genuinely must be shared. Document the boundary or you will get two sources of truth and a class of "passes locally, fails in CI" bugs.
  4. Fork-ready posture. Pin the version exactly, and keep an internal base TestCase that composes the vendor traits behind your own class names. If the package goes quiet, you swap the implementation under a stable internal API instead of touching every test file.
  5. Agent workflow last. Enable the SKILL.md-driven generation only after the human conventions are reviewed and stable, and only with the same review bar as hand-written tests.

Compatibility

  • Treat Pest major, Testbench major, and Laravel major as three independent upgrade triggers. The package sits on all three, so your annual framework upgrade now has a fourth dependency in the critical path.
  • Verify behaviour under your actual CI matrix (PHP versions, DB engines, parallel workers) before rollout, not after. The transaction guarantee is the specific thing to prove.
  • Check for expectation name collisions against any other Pest plugin already in the suite before the first merge.

Sequencing

  • Phase 0 (1 week): spike on one low-risk package; capture baseline test runtime, flake rate, and CI cost.
  • Phase 1 (2–3 weeks): pilot on one bounded package with a named champion; publish an internal README mapping "our conventions" onto "their conventions".
  • Phase 2: adopt on new packages only, as the default template, for one quarter. Existing packages are untouched.
  • Phase 3: retroactively migrate packages that are already being actively modified, if Phase 2 metrics held.
  • Gate between every phase: no measurable regression in runtime or flake rate, and no unanswered questions from the list above.

Operational Impact

Maintenance

  • Low mechanical maintenance (dev-only, small surface), but real editorial maintenance: someone must own the conventions, review against them, and reconcile drift when the vendor changes defaults.
  • Expect an upgrade task on every Laravel/Pest/Testbench major. Budget it explicitly rather than discovering it during a framework upgrade crunch.
  • If you fork, you own the fork. Estimate 0.1–0.2 FTE of a senior engineer as steady-state cost for ownership, review, and upgrades.

Support

  • Assume vendor-only support. With 1 star and 0 dependents there is no community, no Stack Overflow corpus, and no third-party blog coverage — every question is a ticket to the OpenDXP team or an internal investigation.
  • Establish a support expectation in writing (channel, response target, whether issues/PRs are accepted) before broader rollout, and identify an internal escalation owner.
  • Have a documented exit: the fork-and-pin path described above, with a trigger condition (e.g., no release for two framework majors, or an unfixed breaking incompatibility).

Scaling

  • The scaling axis is not traffic, it is suite size and contributor count. Transactional isolation and one-action tests scale well; unconstrained helper and expectation growth does not.
  • Parallel execution is the real scaling test — confirm worker isolation before the suite grows past the point where serial runs become the bottleneck.
  • Helper proliferation is the governance cost of scale: the "helper moves to tests/Helpers/<subject>.php once a second file needs it" rule is good, but requires enforcement or the shared namespace becomes a dumping ground.

Failure modes

  • Config drift between phpunit.xml and config/test.yaml, producing environment-dependent results.
  • Silent isolation failure where the transaction rollback does not apply (DDL, multi-connection, browser tests) and state leaks between tests, creating order-dependent flakes.
  • Expectation collision from process-wide registration, surfacing as failures that only appear in certain test orderings.
  • Silent skips — tests that skip themselves when an external service variable is absent will quietly shrink effective coverage in CI unless skip counts are tracked and alarmed.
  • Convention compliance mistaken for correctness — especially with agent-generated tests: green, well-structured, and asserting the wrong thing.
  • Abandonment — the vendor stops releasing and a framework upgrade blocks the whole suite.

Ramp-up

  • The SKILL.md is the strongest onboarding asset here: it is a ready-made review checklist and a usable prompt for coding agents, which measurably shortens the path from "wrote a test" to "wrote a test we would merge."
  • Realistic ramp: half a day for a Pest-fluent engineer, 1–2 days for a PHPUnit-native engineer plus a reviewer adjustment period.
  • Pair it with a CI-enforced lint (line length, one-call-per-line chains, forbidden only()/todo()/dd()/ray()) so the conventions are enforced by tooling rather than by reviewer memory. Without that, convention decay is the default outcome.

Recommendation: conditional pilot, not portfolio-wide adoption. The risk is contained and the convention asset is genuinely valuable, but with 1 star, 0 dependents, and no visible external validation, this should earn adoption package-by-package against measured runtime and flake-rate baselines — with a pinned version, an internal wrapper, and a written exit path from day one.

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.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator