It's possible that your .env.testing file is not being loaded properly. Try running php artisan config:clear to clear the configuration cache and then run your tests again. If that doesn't work, try explicitly specifying the environment file when running your tests:
php artisan test --env=testing
If that still doesn't work, you can try manually loading the environment file in your tests by adding the following code to the top of your test file:
use Illuminate\Foundation\Testing\RefreshDatabase;
class MyTest extends TestCase
{
use RefreshDatabase;
public function setUp(): void
{
parent::setUp();
$this->loadEnvironmentVariables();
}
// ...
}
This will load the environment variables from your .env.testing file before running your tests.