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 Extensions Laravel Package

padraic/phpunit-extensions

A collection of extensions and helpers for PHPUnit by Padraic Brady, offering convenience assertions, mock utilities, and testing shortcuts that reduce boilerplate and help you write cleaner, more maintainable PHP unit tests.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a test-time extension library, not a runtime dependency. It hooks into PHPUnit's extension surfaces — test listeners, custom constraints, custom assertions, and base TestCase subclasses — to support the Humbug mutation-testing workflow. Two architectural problems follow. First, those surfaces are PHPUnit-internal APIs that have been rewritten repeatedly (namespacing in PHPUnit 6, void return types in 8, TestListener removal and attribute-based configuration in 10, stricter typing in 11). A package last released in September 2017 targets PHPUnit 5/6-era internals. Second, its reason for existing has evaporated: Humbug is itself archived and superseded by Infection. On a modern Laravel stack, Illuminate\Foundation\Testing\TestCase, Collision, and Pest already occupy the customization layer this package would want.

Integration feasibility. Poor. Composer 2 with strict platform checks will almost certainly reject it on Laravel 10/11 (PHP 8.1+, PHPUnit 10/11): the 2017 constraints pin PHP and PHPUnit to versions we no longer run. Forcing installation via --ignore-platform-reqs or version aliasing is itself a red flag. Packagist shows zero dependents, so there is no evidence of anyone integrating it in recent memory — no recipes, no issue threads, no upstream triage to lean on. Even if it installs, the listeners and hooks it overrides may simply never fire under PHPUnit 10+, producing the worst outcome available to a test tool: green builds that assert nothing.

Technical risk: high. Abandoned and archived means no bug fixes, no compatibility patches, and no security advisories ever. The BSD-3-Clause license is permissive and not a concern; maintenance is. Blast radius is confined to CI if kept in require-dev, but an unpatched dev dependency still executes code in CI with repository credentials, which is a real supply-chain surface. Note also that the package's 0.1025 score and 12.81 opportunity rating are consistent with what the metadata shows: low adoption, low momentum, no forward path.

Key questions.

  1. What specific capability do we believe we need here — name the assertion, constraint, or listener. Is there a native PHPUnit 10/11 equivalent?
  2. Is the underlying goal mutation testing? If so, why not Infection (actively maintained, Laravel-aware)?
  3. Does our pinned PHPUnit version still dispatch the extension points this package overrides?
  4. If we vendor or fork, who is the named owner and what is the exit plan?
  5. Is the value in the code (typically small and portable) or in the package (dead)? If it's the code, port it.

Integration Approach

Stack fit. Effectively none for a current Laravel application. Laravel 10/11 ships PHPUnit 10/11 and PHP 8.1+, and Pest is a common default; this package predates all of it. It only fits a legacy PHP 5.6/7.0 + PHPUnit 5/6 codebase — and even there it should be treated as a liability rather than an asset.

Migration path. There is no upstream migration. Ranked options:

  1. Replace — reimplement the behavior with native PHPUnit assertions/constraints, or adopt Infection for the mutation-testing use case. Preferred.
  2. Port — the useful surface is usually a handful of constraint/assertion classes. Copy them into tests/Support/, re-namespace to the application, add modern types and attributes, and own them. Typically a day of work and it removes the dependency entirely.
  3. Fork — only if a genuinely non-trivial piece is required. Budget for permanent ownership as an internal package with a named maintainer.
  4. Vendor as-is — last resort; pin hard and isolate.

Compatibility. Declared support stops at the PHPUnit 5/6 and PHP 5.6/7.0 era. Since then: assertRegExp and string-haystack assertContains were removed (PHPUnit 9), setUp/tearDown require : void (8), TestListener was removed in favor of events/subscribers and docblock metadata has been progressively replaced by attributes (10+). None of these are survivable without modification. Laravel's ParallelTesting and Collision can further interfere with custom listeners.

Sequencing (if pursued despite the recommendation).

  1. Spike in a throwaway branch: pin PHPUnit to the last version the package nominally supports, install with platform overrides, run the suite.
  2. Enumerate precisely which behaviors it provides that native PHPUnit does not.
  3. Reimplement those behaviors in tests/Support with modern types and attributes.
  4. Delete the dependency and verify parity — an Infection mutation score is the strongest proof.
  5. Do not introduce it into any new project.

Operational Impact

Maintenance. Archived since 2017 with no releases in roughly eight years. Every future PHP or PHPUnit upgrade becomes an unbounded risk, and the ownership cost lands entirely on us. The realistic trade is one to two days to port versus a recurring tax to keep a dead dependency compiling.

Support. No maintainer, no issue triage, no documentation beyond a 2017 README. Internal search and Stack Overflow will return essentially nothing. Engineers onboarding onto the 2017 idioms learn knowledge that does not transfer to anything else in the stack.

Scaling. Test-time only: no production runtime footprint, no request-path latency, no database impact. It scales with suite size and CI parallelism, where custom listeners are a known source of serialization and flakiness problems — particularly under paratest or Laravel ParallelTesting. The scaling concern is CI wall-clock time and false confidence, not throughput.

Failure modes.

  • Silent pass — the extension does not fire under a newer PHPUnit and tests appear green while asserting nothing. Highest severity for a test tool, and the hardest to detect.
  • Hard break on upgrade — a fatal error or Composer conflict blocks the pipeline. Easy to spot, and removal is the fix.
  • Nondeterministic CI — listener state leaks under parallel execution.
  • Supply chain — dev-only, but still executes in CI with repository credentials and will never receive a patch.

Ramp-up. The concept (custom assertions and constraints) is simple; the specific 2017 implementation is not. Estimate under one day for a senior PHP engineer to audit and port the useful pieces, and zero days if we standardize on native equivalents or Infection.

Bottom line: do not adopt. This is an archived, zero-dependent, 2017 artifact whose originating project is itself retired. Treat it as reference code, not a dependency — port any genuinely useful constraint into tests/Support, and use Infection if the underlying need is mutation testing.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings