After updating from Laravel 10 to 11, the --parallel tag does not work when testing. Testing normally still works.
# php artisan test --parallel
ParaTest v7.7.0 upon PHPUnit 11.5.2 by Sebastian Bergmann and contributors.
PHP Fatal error: Uncaught Error: Call to undefined method class@anonymous::createApplication() in laravel/framework/src/Illuminate/Testing/Concerns/RunsInParallel.php:175
this is my TestCase.php
<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
/**
* Creates the application.
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
return $app;
}
}
This is some of the packages in my composer.json
"php": "^8.2",
"ext-imagick": "*",
"ext-intl": "*",
"ext-json": "*",
"laravel/fortify": "^1.20",
"laravel/framework": "^11.34",
"laravel/horizon": "^5.22",
"laravel/pennant": "^1.9",
"laravel/reverb": "*",
"laravel/sanctum": "^4.0",
"laravel/scout": "^10.8",
"laravel/slack-notification-channel": "^3.2",
"laravel/telescope": "^5.0",
"laravel/tinker": "^2.9",
"laravel/ui": "^4.4",
...
},
"require-dev": {
"brianium/paratest": "^7.7",
"phpunit/phpunit": "^11.0.1",
...
composer require brianium/paratest --dev. parallel testing worked before the laravel 11 update