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
Phpunit Extensions

Phpunit Extensions Laravel Package

lastdragon-ru/phpunit-extensions

PHPUnit extensions for PHP projects, adding extra test utilities and helpers to streamline assertions, fixtures, and test setup. Designed to integrate cleanly with PHPUnit and improve developer productivity in automated testing workflows.

View on GitHub
Deep Wiki
Context7

Various useful assertions/extensions for PHPUnit.

Frequently asked questions about Phpunit Extensions
Does this package work with Laravel’s built-in PHPUnit setup (e.g., `php artisan make:test`)?
Yes, it integrates seamlessly with Laravel’s PHPUnit configuration. Since it’s a PHPUnit extension, no additional Laravel-specific setup is required—just install it via Composer and use the helpers in your test classes. It plays well with Laravel’s testing utilities like `DatabaseTransactions` or `actingAs()`.
What Laravel-specific testing gaps does this package fill? Are there better alternatives?
This package focuses on generic PHPUnit improvements (e.g., reusable assertions, fixture helpers) rather than Laravel-specific features. For Laravel, native tools like `assertSeeInResponse()`, `assertDatabaseHas()`, or `assertRouteIsCached()` often cover framework-specific needs. Use this only if you need broader PHPUnit enhancements beyond Laravel’s built-in helpers.
Will this package break when Laravel upgrades PHPUnit (e.g., to PHPUnit 10+)?
There’s a risk of compatibility issues since the package lacks a public repository or maintenance updates. PHPUnit 10+ introduces breaking changes, so test thoroughly in a staging environment if adopting this. Monitor for forks or alternatives if the package becomes abandoned.
How do I install and configure this for a Laravel project?
Install via Composer: `composer require lastdragon-ru/phpunit-extensions`. No additional configuration is needed—it auto-loads as a PHPUnit extension. Use the provided helpers (e.g., `assertArrayContains()`, custom fixtures) directly in your test classes. Works out-of-the-box with Laravel’s `TestCase`.
Does this package support Laravel’s testing features like `refreshDatabase()` or `actingAs()`?
No, this package is framework-agnostic and focuses on generic PHPUnit improvements. Laravel’s testing features (e.g., `refreshDatabase()`, `actingAs()`) are handled by Laravel’s core testing utilities. Use this package only for non-Laravel-specific test optimizations like reusable assertions or data fixtures.
Are there performance concerns with using this package in CI/CD pipelines?
The package is lightweight and should not significantly impact test execution speed, as it only adds assertions and utilities. However, complex custom assertions could introduce minor overhead. Profile your tests if performance is critical, especially in CI environments with tight time constraints.
What assertions or helpers does this package provide? Are they unique to Laravel?
The package offers generic PHPUnit helpers like reusable test utilities, cleaner fixture management, and assertion shortcuts (e.g., `assertArrayContains()`). These are not Laravel-specific—think of it as a toolkit for writing cleaner PHPUnit tests across any PHP project, including Laravel.
Can this package conflict with other PHPUnit extensions (e.g., `spatie/laravel-test-factory`)?
Potential conflicts exist if multiple extensions modify the same PHPUnit behavior (e.g., custom assertions or test listeners). Test thoroughly in a sandbox environment before adopting. Laravel’s native testing tools (e.g., `spatie/laravel-test-factory`) are safer for framework-specific needs.
Is this package actively maintained? What’s the risk of using it in production?
The package lacks a public repository, GitHub activity, or maintenance updates, which introduces risk. If abandoned, future PHPUnit versions or Laravel updates could break compatibility. Use only in non-critical projects or fork it for long-term reliability.
How can I test this package’s reliability before integrating it into a Laravel project?
Start by adding it to a disposable test project and run your existing test suite to check for conflicts. Focus on edge cases (e.g., async assertions, complex data fixtures) to ensure stability. Since it’s framework-agnostic, Laravel-specific tests won’t cover all use cases—validate with your own test scenarios.
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor