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

Abstract Testframework Adapter Laravel Package

infection/abstract-testframework-adapter

Shared abstractions for Infection test framework adapters. Provides the TestFrameworkAdapter and TestFrameworkAdapterFactory interfaces so custom adapters can translate Infection's test execution requests into target framework commands and return collected test locations.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: This is a low-level abstraction package that defines the contracts (TestFrameworkAdapterInterface, AbstractTestFrameworkAdapter) Infection's mutation testing engine uses to talk to any PHP test framework (PHPUnit, Pest, ParaTest). It is not a feature product — it is an internal seam that makes Infection framework-agnostic. For a Laravel/PHP team, the only scenario where this package enters your architecture is when you are either (a) writing a custom Infection adapter for a test framework Infection doesn't natively support (e.g., a bespoke in-house runner, a legacy PHPUnit fork), or (b) maintaining a fork/vendored copy of Infection. Direct application code should never depend on it.

Integration feasibility: High technical feasibility, low product feasibility. The surface is small: extend AbstractTestFrameworkAdapter, implement runTests(), getName(), checkVersion(), and (since 0.5.0) optionally hasSyntaxError() via the new HasSyntaxErrorDetection interface. Boilerplate is limited and the abstraction handles process spawning, config generation, and exit-code mapping. The blocker is not implementation difficulty — it's whether you need it at all. With 25 stars and zero declared dependents, you are adopting a package whose real consumer base is the Infection maintainers themselves.

Technical risk: High, concentrated in three areas.

  • Abandonware / single-maintainer risk: Release history shows a small number of interface-changing versions (0.3.0 renamed CoverageLineData → TestLocation and removed JUNIT_FILE_NAME; 0.4.0 added a BC-breaking checkVersion() requirement). The package has historically shipped BC breaks in minor versions, and the roadmap is opaque.
  • Compatibility drift: No confirmed support statements for PHP 8.2+ or Infection v1.x. checkVersion() was added to let adapters declare minimum framework versions, but the contract itself changes shape over time. Any custom adapter you write is exposed to both Infection's and this package's version bumps.
  • Silent coupling: The dependency tree inherits Infection's own transitive constraints (PHPUnit, Symfony Process, etc.). Because there are effectively no independent consumers, breakage is only surfaced when Infection upgrades — i.e., the worst possible time.

The one genuine addition here (0.5.0's HasSyntaxError interface) is a small but real capability: it lets adapters distinguish ParseError-style output from ordinary test failures, which reduces false-negative mutation results and flaky CI signal. That's valuable if you own an adapter; it is irrelevant otherwise.

Key questions to resolve before any commitment:

  1. Do we actually run Infection in production CI today, or is mutation testing a future initiative? (If not, do not adopt.)
  2. Is Infection's core still consuming this package, or has it been folded into the main repo? Verify against Infection's current composer.json — this determines whether the package is a durable seam or a legacy shim.
  3. Do we have a test framework Infection doesn't natively support? If not, use infection/phpunit-adapter or infection/pest-adapter directly and never touch the abstract layer.
  4. Who owns the adapter if we write one? An adapter is a small but permanent maintenance liability tied to framework internals.
  5. Does the new HasSyntaxError contract handle PHP 8.x Throwable/ParseError output the way our framework emits it? Needs empirical verification, not docs reading.

Integration Approach

Stack fit: Narrow. In a Laravel codebase the relevant stack is Laravel + Pest/PHPUnit + Infection. In that combination you use Infection's official adapters and this package is a transitive, invisible dependency — correct behavior is to pin it and ignore it. The package only becomes a first-class dependency in two cases: (1) you are extending or forking Infection itself, or (2) you have a custom test runner (e.g., a proprietary testing DSL, a Dusk-style browser runner, or a legacy framework being strangled) that you want mutation-tested.

Migration path (only if adopting as a direct dependency):

  1. Confirm necessity — write down the specific framework Infection can't drive. If the answer is PHPUnit/Pest, stop.
  2. Baseline the ecosystem — pin infection/infection, infection/phpunit-adapter (or Pest equivalent), PHP, and this package together in a throwaway branch. Get a green mutation run before writing any adapter code.
  3. Implement the adapter incrementally — start from AbstractTestFrameworkAdapter, implement getName() and runTests() only, and validate against a real test suite in a separate consumer project (this package has no meaningful test suite of its own; your adapter is the test).
  4. Add checkVersion() — declare the minimum framework version you support so Infection fails loudly on drift rather than silently mis-parsing.
  5. Layer in HasSyntaxErrorDetection — treat as an enhancement, not a launch requirement. Validate that it doesn't misfire on warnings, deprecations, or suppressed errors.
  6. Isolate and wrap — put the adapter in its own package/namespace with no upstream dependents, so a future Infection change is a contained fix rather than a refactor.

Compatibility: Assume backward compatibility to PHP 7.4 per the release notes; PHP 8.2+ is untested by the maintainers. The 0.4.0 checkVersion() addition is the compatibility escape hatch — use it. Result-parsing is the fragile zone: PHPUnit 9.6 → 10+ changed output formats materially (attributes, JSON structure), so branch parsing on getVersion() and keep a fixture-based regression suite of captured framework output.

Sequencing: (1) confirm Infection is already adopted, (2) confirm the framework gap, (3) prototype adapter against a single small test suite, (4) harden with version sniffing and syntax-error detection, (5) only then roll into CI. Do not sequence this ahead of an Infection rollout — it has no standalone value.


Operational Impact

Maintenance: Low ongoing code cost, elevated ongoing risk cost. The adapter itself is a few hundred lines. The real cost is tracking Infection releases, framework output-format changes, and PHP minor versions in a package whose release cadence and BC discipline are unpredictable (multiple minor-version BC breaks in its own short history). Budget roughly one engineer-day per Infection major and per test-framework major to re-validate parsing.

Support: Effectively self-support. 25 stars, no community forum, no active discussion surface. If the maintainer steps back, your fallback is forking — which is viable because the package is small, but only if you've kept your adapter decoupled. Treat "we can vendor it" as the actual support contract.

Scaling: Not a scaling concern in the conventional sense. It doesn't serve traffic or hold state; it impacts throughput only indirectly, via whether mutation runs are accurate (false syntax-error classification corrupts results) and whether adapters can be parallelized. Note the adapter layer does not manage concurrency — if you run mutation tests in parallel, that is yours to arrange and to de-risk against flaky framework output.

Failure modes to design for:

  1. Silent breakage — Infection or PHP upgrades, adapter keeps running, output parsing quietly misreads results. Mitigation: checkVersion(), golden-fixture parsing tests, and a fail-loud contract on unrecognized output.
  2. Misclassified syntax errors — HasSyntaxErrorDetection returns incorrect true/false, corrupting mutation scores. Mitigation: only enable after validating against real ParseError samples; be conservative.
  3. Abandonment — package goes stale while Infection moves on. Mitigation: keep the adapter isolatable; avoid referencing package types in application code.
  4. Dependency vulnerability — transitive PHPUnit/Process constraints inherit their own CVE exposure. Mitigation: standard Composer audit in CI; treat as you would any dev dependency.
  5. Fork divergence — if you fork, you own merge burden forever. Mitigation: patch narrowly, upstream where possible, and document the delta.

Ramp-up: Engineer ramp-up is roughly half a day to a day for someone comfortable with PHPUnit internals and Composer — the interfaces are small and self-documenting. The harder ramp is organizational: getting the team to accept a lightly-maintained abstraction under their CI pipeline. Recommendation for a TPM: do not adopt as a direct dependency unless you have a genuine framework gap. If you do, treat it as an experimental, isolated integration with a named owner and a documented exit path — forked copy in-repo — and revisit the decision at each Infection major. If you're a standard Laravel + Pest/PHPUnit shop, use Infection's official adapters, pin this transitively, and spend zero roadmap attention on it.

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.
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk