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

wyrihaximus/test-utilities

Test utilities for api-clients packages, providing a PHPStan extension so test classes can extend WyriHaximus\TestUtilities\TestCase, with automatic registration via phpstan/extension-installer or manual inclusion of extension.neon.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Test Infrastructure Alignment: The package remains a PHP/Laravel-oriented test utility layer for PHPUnit, PHPStan, and Rector—core tools in modern Laravel builds. Release 14.5.0 does not change that positioning; it is a maintenance release consisting of dependency and CI workflow bumps only.
  • Modularity: Preconfigured test cases, randomized namespaces/directories, and Rector/PHPStan wrappers still reduce boilerplate without touching Laravel's runtime architecture. None of this release's changes alter the public API surface, the class layout, or the extension points the previous assessment relied on.
  • Toolchain Synergy: Unchanged. The package sits in the dev-dependency layer and integrates with Laravel's DI container and testing helpers (RefreshDatabase, DatabaseMigrations) only through inheritance or composition in your own base test case.
  • Version Trajectory: The package has moved from 13.2.0 (the version the prior assessment was written against) to 14.5.0. That is a major-version crossing plus ~5 minor releases in the review window, all driven by the same single automated contributor. Architectural fit is stable; the surrounding dependency envelope is not.

Integration Feasibility

  • Low Friction (unchanged): composer require --dev wyrihaximus/test-utilities plus extending the provided TestCase remains the whole install story. No service provider, no config publish, no runtime footprint.
  • Laravel-Specific Gaps (unchanged):
    • Database Testing: Still no native Laravel database utilities. Pairing with DatabaseMigrations / RefreshDatabase via a project-local trait remains mandatory.
    • Artisan/Console Testing: Still no Artisan::call()-style helpers; wrappers remain your responsibility.
    • HTTP/Feature Testing: Laravel's MakesHttpRequests and assertion helpers are not covered.
  • Static Analysis: The wyrihaximus/phpstan-rules-wrapper constraint moved to ^14.10.1 (from effectively ^14.9.0 mid-cycle). Expect a larger and stricter ruleset than Laravel Shift's default PHPStan rules; validate baseline output before enabling in CI as a blocking gate.
  • Composer replace Overrides Are Not Recommended: The previous assessment sketched a composer.json replace block to force PHPUnit 9.5.22. This is not a viable long-term integration strategy—it defeats the package's own version guards and will silently break at the next constraint bump. Downgrade that guidance to "avoid"; prefer selecting a package major that matches your Laravel/PHPUnit line, or wait.

Technical Risk

  • PHPUnit 13.x Is Now the Explicit Floor — this is the headline change and it materially escalates risk:
    • Release 14.5.0 bumps phpunit/phpunit to ^13.4.1. The prior assessment flagged PHPUnit 12.x as a stretch against Laravel 10/11; the package is now a full major beyond that.
    • Laravel 10 ships PHPUnit 9.6/10.x; Laravel 11 ships 10.5/11.x; Laravel 12 ships 11.x/12.x. No currently supported Laravel LTS line ships PHPUnit 13. Unless the package's constraint is a dev-only allowlist (require-dev style) rather than a hard require, Composer will refuse to co-install.
    • PHPUnit 13 is expected to carry a PHP 8.4+ floor. Confirm against your platform matrix before assuming compatibility with Laravel apps on PHP 8.2/8.3.
  • Transitive Dependency Drift:
    • wyrihaximus/qa-tooling-wrapper ^2.4.0 and wyrihaximus/makefiles ^0.15.2 pull their own Symfony/tooling constraints. These are the vectors most likely to collide with Laravel's Symfony 7.x pins (the previous assessment noted Symfony 8.x exposure at 12.x; the risk has not decreased).
    • wyrihaximus/phpstan-rules-wrapper moves on its own fast cadence (three bumps inside this single release: 14.9.0 → 14.10.0 → 14.10.1). Each bump can change rule severity and produce new CI failures without any change to this package's own code.
  • Breaking Changes: No source changes in 14.5.0, so no API breakage in this release. The breaking event is the 13.x → 14.x major that already landed between assessments, and it was driven by exactly this kind of dependency churn. Treat any future major as a potential PHPUnit floor jump.
  • Maintenance Signal: 10 PRs, 0 issues resolved, 1 contributor, all from renovate-runner[bot], including one autoclosed PR. This is a bot-only maintenance cadence: no human review trail for integration concerns, no roadmap, no Laravel-specific triage. Weigh this heavily if you intend to standardize on the package across teams.
  • Customization Overhead (unchanged): Laravel's opinionated TestCase traits (HttpTests, FeatureTests, InteractsWithDatabase) will need to be re-mixed into a project-local base class.

Key Questions

  1. Compatibility
    • Is phpunit/phpunit ^13.4.1 a hard require or a scoped dev constraint? If hard, no supported Laravel LTS version can co-install without overrides—this is a go/no-go question.
    • Which PHP floor does 14.5.0 imply (8.4+?), and does that match the Laravel versions you operate?
    • Do qa-tooling-wrapper ^2.4.0 / makefiles ^0.15.2 transitively require Symfony 8.x, and does that conflict with your Laravel's Symfony pin?
  2. Testing Scope
    • Do randomized directories/files still need bridging into storage_path() / public_path()?
    • How are migrations, seeders, and factories handled—project-local trait, or a maintained fork?
  3. Static Analysis
    • What is the delta in findings when phpstan-rules-wrapper ^14.10.1 is applied to an existing Laravel codebase (expected: substantially more than Shift's baseline)?
    • Will Rector's docblock-to-attribute conversion collide with Laravel's @mixin / @method conventions on models and facades?
  4. Maintenance Ownership
    • Given no human-authored changes and a single automated contributor, who owns the fork if a Laravel-compatible patch is required?
    • What is the upgrade policy when the package pins a PHPUnit major ahead of Laravel again?

Integration Approach

Stack Fit

  • PHPUnit Integration:
    • Extend the package TestCase from a project-local base class that also composes Laravel's traits:
      use WyriHaximus\TestUtilities\TestCase as PackageTestCase;
      use Illuminate\Foundation\Testing\RefreshDatabase;
      
      abstract class TestCase extends PackageTestCase
      {
          use CreatesApplication;
          use RefreshDatabase;
      }
      
    • Prerequisite: resolve the PHPUnit 13 vs. Laravel-shipped PHPUnit gap first. If it cannot be resolved cleanly, stop here—everything downstream depends on it.
  • PHPStan:
    • Merge the wrapper's extensions into phpstan.neon and run a baseline capture before making it blocking. Expect an initial triage pass.
  • Rector:
    • Extend WyriHaximus\TestUtilities\RectorConfig rather than replacing rector.php wholesale, so Laravel-specific rulesets survive.
    • Run --dry-run across the codebase and diff the proposed changes before enabling.

Migration Path

  1. Phase 0: Compatibility Gate (new, mandatory)
    • In a throwaway branch, resolve the dependency graph against your exact Laravel/PHP/PHPUnit matrix: composer require --dev wyrihaximus/test-utilities:^14.5 --dry-run.
    • Outcome A (resolves): proceed to Phase 1.
    • Outcome B (conflicts): either pin to the highest package major that co-installs cleanly with your Laravel line, or do not adopt. Do not use replace overrides to force it.
  2. Phase 1: Proof of Concept
    • Non-production Laravel app or feature branch. Exercise randomized directories and a handful of unit tests. Validate PHPStan and Rector against existing config in report-only mode.
  3. Phase 2: Incremental Adoption
    • Extend the new base TestCase for new test files only; leave legacy suites on Laravel's stock TestCase.
    • Merge PHPStan extensions incrementally with a generated baseline; monitor false positives per rule.
    • Rector in --dry-run per module.
  4. Phase 3: Full Integration
    • Wire Rector into pre-commit, PHPStan into CI as blocking, and retire bespoke test utilities.
    • Re-validate the full dependency graph at every package minor bump (see cadence note below).

Compatibility

  • Laravel-Specific Workarounds:
    • Database Testing: project-local trait composing package utilities with RefreshDatabase/DatabaseMigrations.
    • Artisan Testing: thin wrapper methods around Artisan::call() added to the local base case.
    • HTTP Testing: retain Laravel's MakesHttpRequests at the local base class level.
  • Version Alignment:
    • Pin the package to an exact minor ("wyrihaximus/test-utilities": "14.5.0") rather than a caret range. Given a bot-driven release stream with an explicit PHPUnit 13 floor, a caret range is an uncontrolled upgrade vector.
    • Use composer.lock as the contract; avoid replace hacks to force PHPUnit downgrades.
  • PHP/Platform: confirm the package's PHP floor against your runtime; if it is 8.4+, apps on 8.2/8.3 are out of scope for this major.

Sequencing

  1. Dependency-graph gate (Phase 0) — nothing else proceeds until this passes.
  2. Static analysis — lowest blast radius, highest early signal.
  3. Test base class — new files first, legacy later.
  4. Rector — last, per module, --dry-run first.

Operational Impact

Maintenance

  • Pros:
    • Test scaffolding boilerplate (temp dirs, randomized namespaces) stays out of your codebase.
    • Dependency currency is handled upstream—demonstrated concretely by 14.5.0, which absorbed six tooling dependency bumps you did not have to make.
  • Cons:
    • Upstream cadence is faster than Laravel's: 13.2.0 → 14.5.0 with a PHPUnit major jump. Each minor can move a transitive constraint.
    • Bot-only changes: 0 issues resolved, 1 contributor, all Renovate. There is no human signal about downstream compatibility with Laravel.
    • Fork likelihood: if you need Laravel-aligned PHPUnit support, you will probably maintain a patch.
  • Mitigation:
    • Exact-version pinning; treat every bump as a change request requiring a green CI run.
    • Maintain a documented private fork/branch policy for Laravel-specific patches.
    • Record the current compatible matrix in CONTRIBUTING.md.

Support

  • Community: Effectively zero dependents and no external issue traffic in this release. Do not expect Laravel-specific answers upstream.
  • Maintainer: Single-maintainer, automation-driven project. Escalation path is limited; assume self-sufficiency.
  • SLA: None. Package releases are Renovate-driven and irregular in impact but frequent in count. Align reviews with your own dependency-review cycle rather than the package's release cadence.
  • Ecosystem: Use Laravel channels (Slack, forums, Shift docs) for integration questions; upstream is unlikely to help with Laravel-specific behavior.

Scaling

  • Performance:
    • Rector docblock-to-attribute conversion is the main CI cost; parallelize per module and exclude vendor/generated paths.
    • PHPStan with the wrapper's ruleset increases analysis time and memory—enable result-cache and tune --memory-limit.
    • Neither cost scales with app size the same way as test execution; test suite growth remains the dominant factor.
  • Team Adoption:
    • Onboarding is short (1–2 hours) for the test utilities, but longer for the static-analysis ruleset—budget a triage pass for existing code.
    • Document the local base TestCase as the single entry point so developers never extend the package class directly.

Failure Modes

Risk Impact Mitigation
PHPUnit 13 floor blocks co-install with Laravel LTS Adoption blocked entirely Phase 0 --dry-run gate; pin to last compatible major; do not replace
Transitive Symfony 8.x conflict via qa-tooling-wrapper Composer resolution failure Lockfile as contract; test resolution before merging Renovate PRs
PHPStan rules-wrapper minor bump changes severities Sudden CI failures on unchanged code Exact pinning; report-only mode for new rules; baseline file
Rector docblock-to-attribute conversion breaks Laravel PHPDoc conventions Broken IDE/static-analysis metadata on models/facades --dry-run diff review; per-module rollout
Package pins a new PHPUnit major ahead of Laravel again Repeat of this exact situation Exact pin + documented upgrade policy; watch release notes for phpunit/phpunit bumps
Maintainer bus factor / no human triage No upstream fix for Laravel-specific gaps Private fork policy; keep Laravel traits in project-local code, not upstream
CI pipeline slowdown from Rector + PHPStan Longer feedback loops Parallelize, cache, scope Rector per module

Ramp-Up

  • Developer Onboarding:
    • 1–2 hours: package docs and extending the local base TestCase.
    • +2–4 hours: static-analysis triage familiarity, understanding the wrapper ruleset's output and how to baseline it.
    • +Half day (platform owner): dependency-graph validation for the PHPUnit 13 / Symfony constraint envelope, plus a written upgrade policy.
  • Prerequisites: Pin versions, establish the local base class, and confirm the PHP floor before any team-wide rollout.
  • Rollout Recommendation: Treat 14.5.0 as maintenance-only with a raised compatibility bar, not a feature upgrade. The action item this release generates is a re-validation of the dependency graph, not a migration. If the graph does not resolve against your Laravel line, defer adoption and re-evaluate at the next major.
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.
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
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib