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

Product Decisions This Supports

  • Standardizing Test Infrastructure: Adopt this package to unify test utilities across Laravel/PHP projects on the current 14.x line, reducing duplication and ensuring consistency in testing practices (PHPUnit 13, PHPStan rules wrapper 14.x, Rector, and QA tooling configurations).
  • Accelerating Developer Onboarding: Streamline test setup for new team members by providing pre-configured test cases, random namespaces/directories, and tooling defaults (e.g., TestCase base class), now aligned with the PHPUnit 13 toolchain.
  • Improving Code Quality: Leverage the continuously updated PHPStan rules wrapper (now ^14.10.x) and Rector rules to enforce best practices and modernize legacy codebases during development, not just in CI.
  • Roadmap: Test-Driven Development (TDD) Initiatives: Enable faster iteration by integrating mutation testing (infection/infection) and phpunit-slow-test-detector to surface flaky or slow tests early.
  • Build vs. Buy: Buy—this package eliminates the need to reinvent test utilities, saving engineering time while maintaining flexibility for customization. The 14.x line shows a steady stream of dependency currency via automated maintenance, so the "buy" cost includes low ongoing maintenance overhead.
  • Version Trajectory Note: The project has moved from 13.2.0 → 14.5.0, a major-line jump. Plan an upgrade window if you're still on 13.x—the 14.x baseline tracks PHPUnit 13, which raises the PHP runtime floor.
  • Use Cases:
    • Laravel Monorepos: Standardize testing across microservices or modules.
    • Legacy Code Refactoring: Use Rector configurations to migrate docblocks to attributes and apply consistent refactors.
    • CI/CD Optimization: Reduce test suite noise with slow-test detection and randomize test environments to catch edge cases.
    • Toolchain Currency: Keep QA tooling (PHPStan wrapper, makefiles wrapper, GitHub workflows) in lockstep without manual Renovate babysitting.

When to Consider This Package

  • Adopt if:

    • Your team uses PHPUnit 13, PHPStan, or Rector and wants to reduce boilerplate in test setup.
    • Your projects run on PHP 8.4+ (the PHPUnit 13 baseline in the 14.x line requires it)—verify this before committing.
    • You maintain multiple Laravel/PHP projects and need consistent testing standards.
    • Your roadmap includes TDD, mutation testing, or large-scale refactoring (e.g., docblock-to-attribute migration).
    • You prioritize developer productivity over custom test utilities, and you're comfortable riding a fast-moving, actively-maintained dependency line.
  • Look elsewhere if:

    • Your stack doesn't use PHPUnit/PHPStan/Rector (e.g., JavaScript-heavy projects).
    • You are pinned to PHP < 8.4—the 14.x line's PHPUnit 13 dependency may block adoption; stay on a 13.x release or defer the upgrade.
    • You need highly specialized testing tools (e.g., performance profiling, UI testing) not covered here.
    • Your team prefers minimal dependencies—this package bundles several tools (PHPUnit, PHPStan, Rector, makefiles, GitHub workflows).
    • You require enterprise-grade support (this is a community-maintained MIT-licensed package).

How to Pitch It (Stakeholders)

For Executives: "This package standardizes our PHP testing infrastructure, cutting onboarding time and reducing test-related bugs through built-in tooling like PHPStan and Rector. The 14.x line is actively maintained—recent releases show continuous, automated dependency updates (PHPUnit 13, PHPStan rules wrappers, CI workflows)—so it stays current without us burning engineering cycles. It's a low-risk, high-reward investment in code quality and developer velocity: 'Convention over Configuration' for testing. One caveat: the recent major-line jump means we should confirm our PHP runtime floor (8.4+) before adopting, but for teams already there, it's a safe bet in the Laravel ecosystem."

For Engineering: *"WyriHaximus' test utilities (now on 14.5.0) give us:

  • Pre-configured PHPUnit 13 test cases with random namespaces/directories for isolated testing.
  • Updated Rector integration to automate docblock-to-attribute migrations and enforce modern PHP practices.
  • PHPStan rules wrapper ^14.10.x and QA tooling wrapper ^2.4.0 to catch type issues early and standardize QA.
  • Tooling for slow/flaky tests to keep our CI fast and reliable.
  • Automated upstream maintenance (Renovate keeps PHPUnit, PHPStan, makefiles, and GitHub workflows updated), so we get security/currency updates on autopilot. It's a drop-in solution—just extend TestCase and start testing faster. Note the 14.x major bump raises the PHP baseline to 8.4+; check your runtime matrix before upgrading from 13.x."*
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