contributte/phpunit
PHPUnit integration helpers by Contributte for PHP projects. Provides lightweight tooling and conventions to simplify writing, running, and organizing tests, with sensible defaults and compatibility aimed at smoother CI and developer experience.
contributte/phpunit package extends PHPUnit with additional functionality (e.g., custom assertions, test utilities, or Nette Framework integration), making it a fit for projects requiring advanced testing capabilities beyond vanilla PHPUnit.laravel/framework) is highly compatible, but conflicts may arise if:
phpunit.xml or phpunit-neon (Nette) configurations clash.phpunit/phpunit (Laravel typically pins to ^9.5 or ^10.0). The package’s last release (2025-12-29) suggests it may support modern PHPUnit.createMock(), assertDatabaseHas()).TestCase or RefreshDatabase.phpunit.xml? Will it require merging configurations or overriding defaults?spatie/phpunit-mock-factories, pestphp/pest) that offer similar functionality with better Laravel support?phpunit-neon file, merge it with Laravel’s phpunit.xml (prioritize Laravel’s settings).TestCase with the package’s traits or use its custom assertions via use statements.assertDatabaseHas() for a package-specific assertion if it offers advantages).composer.json constraints).Illuminate\Foundation\Testing\TestCaseIlluminate\Testing\AssertionsLaravel\Sanctum\TestingAssertions (if using Sanctum)composer require contributte/phpunit --dev
phpunit.xml to include the package’s extensions (if applicable).<extensions>
<extension class="Contributte\Phpunit\Extension"/>
</extensions>
php artisan test to catch early integration issues.composer.json.php artisan test --profile
| Failure Scenario | Mitigation |
|---|---|
| Package breaks PHPUnit compatibility | Roll back to previous version or remove dependency. |
| Custom assertions fail silently | Add pre-commit hooks to run tests with the package enabled. |
| Nette-specific features break Laravel | Isolate package usage to non-Nette-related tests or refactor. |
| Abandoned package | Fork the repo or extract features into a custom Laravel package. |
assertHasFlash() instead of session()->has()").// Old Laravel way
$this->assertTrue(session()->has('status'));
// New package way (if supported)
$this->assertHasFlash('status');
How can I help you explore Laravel packages today?