Weave Code
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

A set of PHP test utilities for package development: a PHPUnit TestCase with helpers like random namespaces and temp directories, plus ready-made configuration defaults for PHPStan and Rector (paths and docblock-to-attribute conversions).

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Standardizing Test Infrastructure: Adopt this package to unify test utilities (PHPUnit, PHPStan, Rector) across Laravel/PHP projects, reducing maintenance overhead and ensuring consistency in testing practices.
  • Accelerating Developer Onboarding: Provide a pre-configured TestCase base class with utilities like random namespaces/directories to speed up test development for new hires or contributors.
  • Build vs. Buy Decision: Justify adopting this package over custom solutions by highlighting its MIT license, active maintenance (recent releases), and integration with modern tooling (PHPUnit 12, PHPStan 2.x, Rector 2.x).
  • Roadmap for Test Quality: Enable features like slow-test detection (via phpunit-slow-test-detector) and infection-based mutation testing to proactively improve test suite robustness.
  • Migration to PHP 8.x/9.x: Leverage the package’s Rector integration to automate docblock-to-attribute conversions and other modernizations, reducing manual refactoring effort.

When to Consider This Package

  • Adopt if:

    • Your team uses PHPUnit, PHPStan, or Rector and wants standardized configurations.
    • You frequently test file storage, API clients, or directory structures (e.g., Laravel storage paths, cache directories).
    • You’re migrating from docblocks to PHP attributes (Rector support).
    • You need pre-configured test utilities (e.g., random namespaces, slow-test detection) without reinventing the wheel.
    • Your project is Laravel-based or uses Laravel-like directory structures (src/, tests/, etc/).
  • Look elsewhere if:

    • Your tests rely on framework-specific tools (e.g., Laravel’s RefreshDatabase, PestPHP) not covered here.
    • You need advanced mocking (consider Laravel’s Mockery or PHPUnit extensions instead).
    • Your team prefers custom test utilities already aligned with internal coding standards.
    • You’re using non-PHP languages or frameworks (e.g., Node.js, Python).

How to Pitch It (Stakeholders)

For Executives: "This package standardizes our PHP test infrastructure, reducing developer time spent on boilerplate test setups by 30%+ while ensuring consistency. It integrates seamlessly with our Laravel stack, automates modernizations (e.g., docblock-to-attribute conversions), and proactively improves test quality with slow-test detection. The MIT license and active maintenance make it a low-risk, high-reward choice—similar to how we’ve adopted Laravel for backend consistency."

For Engineering: *"WyriHaximus’ test utilities give us:

  • Pre-built TestCase with random namespaces/directories for file-storage tests (no more manual temp dir setup).
  • Rector integration to auto-convert docblocks to attributes, saving hours on refactoring.
  • PHPStan/PHPUnit defaults that align with our static analysis and testing standards.
  • Slow-test detection to catch flaky tests early. It’s a drop-in solution that works with our existing Laravel/PHPUnit setup—just composer require and extend TestCase."*
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai