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

Test utilities

Test utilities for api-clients packages.

Continuous Integration Latest Stable Version Total Downloads Type Coverage License

Installation

To install via Composer, use the command below, it will automatically detect the latest version and bind it with ^.

composer require wyrihaximus/test-utilities

When wyrihaximus/makefiles is present, this package registers as a Composer plugin and adds make on-install-or-update || true to your composer.json scripts on install and update.

Usage

PHPStan

This package provides a PHPStan extension so your test classes may extend WyriHaximus\TestUtilities\TestCase.

When phpstan/extension-installer is enabled, the extension is registered automatically—no manual configuration required.

If extension-installer is not available, include the extension from your PHPStan configuration:

includes:
    - vendor/wyrihaximus/test-utilities/extension.neon

The following PHPStan extensions are provided through wyrihaximus/phpstan-rules-wrapper:

PHPUnit

Extend WyriHaximus\TestUtilities\TestCase in your tests for temporary directories, unique namespaces, and helpers suited to file-storage tests.

Before each test, initializeTemporaryTestEnvironment() creates a unique temporary directory and namespace. After each test, cleanUpTemporaryTestEnvironment() removes them.

Mockery integration is included, along with helpers such as:

  • getTmpDir() — a unique temporary directory for each test
  • getRandomNameSpace() — a unique namespace string for each test
  • getFilesInDirectory() — list files in a directory recursively
  • rmdir() — recursively remove a directory, including symlinks
  • provideTrueFalse() — a data provider for boolean values (don't ask)
  • waitUntilTheNextSecond() — wait until the next second boundary

Rector

Rector configuration is provided through wyrihaximus/rector-config, which pulls in rector/rector and applies defaults for etc, examples, src, and tests. It also converts supported docblock annotations to attributes.

Create etc/qa/rector.php:

<?php

declare(strict_types=1);

use WyriHaximus\RectorPHP\RectorConfig;

return RectorConfig::configure(dirname(__DIR__, 2));

Included tooling

Most QA tooling is bundled through wyrihaximus/qa-tooling-wrapper:

License

The MIT License (MIT)

Copyright (c) 2026 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle