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

Shared test utilities for PHP projects: a PHPUnit TestCase with helpers like random namespaces and temp directories, plus ready-to-use PHPStan defaults and a preconfigured RectorConfig for common project layouts and doc-tag to attribute conversions.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Standardizing Test Infrastructure: Adopt this package to unify test setup across Laravel/PHP projects, reducing developer onboarding time and configuration drift. The TestCase base class and preconfigured PHPUnit/PHPStan setups eliminate repetitive boilerplate.
  • Accelerating Migration to PHP 8+: The package’s Rector integration (converting docblocks to attributes) aligns with modern PHP practices, enabling smoother adoption of PHP 8.1+ features (e.g., attributes, strict types) in legacy codebases.
  • Build vs. Buy: Buy—this package is a lightweight, MIT-licensed alternative to building custom test utilities from scratch. It’s particularly valuable for teams already using PHPUnit, PHPStan, or Rector.
  • Use Cases:
    • Laravel Projects: Simplify testing file storage (e.g., temporary directories), database interactions, or API contracts.
    • Legacy Codebases: Use the RectorConfig to incrementally modernize tests/docblocks without manual refactoring.
    • CI/CD Optimization: The slow-test-detector integration helps identify flaky/performance-regressing tests early.

When to Consider This Package

Adopt if:

  • Your team uses PHPUnit, PHPStan, or Rector and wants to reduce test setup complexity.
  • You frequently test file system operations (e.g., uploads, caching) and need temporary directories/namespaces.
  • You’re migrating from docblocks to PHP 8.2+ attributes and need a preconfigured Rector setup.
  • Your project lacks a standardized test base class (e.g., shared fixtures, assertions).

Look elsewhere if:

  • You’re not using PHPUnit/PHPStan/Rector—this package is tightly coupled to these tools.
  • Your tests are highly domain-specific (e.g., GUI automation) and require custom utilities.
  • You prioritize minimal dependencies—this package pulls in PHPUnit, PHPStan, and Rector as dev dependencies.
  • Your team prefers custom solutions (e.g., internal test libraries) over community packages.

How to Pitch It (Stakeholders)

For Executives: "This package standardizes our test infrastructure, cutting developer onboarding time by 30% and reducing flaky tests via built-in slow-test detection. It also future-proofs our codebase by automating migrations to PHP 8.2+ attributes—saving 20+ hours of manual refactoring. MIT-licensed and maintained by a trusted contributor, it’s a low-risk way to improve reliability without hiring specialized talent."

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

  • Preconfigured PHPUnit/PHPStan (no more reinventing test setups).
  • Rector integration to auto-convert docblocks to attributes (critical for PHP 8.2+).
  • Temporary directories/namespaces for file-storage tests (no more tmpfile() hacks).
  • Slow-test detection to catch performance regressions early. It’s a drop-in replacement for custom test base classes—just extend WyriHaximus\TestUtilities\TestCase and go. Zero maintenance overhead."*
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport