some people around that can help me with testing with Pest and Laravel 11?
namespace TestsFeature;
use AppModelsAgenda;
use function SpatieRouteTestingrouteTesting;
routeTesting('all api routes')
->include('api/*')
->bind('agenda', Agenda::factory()->create())
->assertSuccessful();
And when running: php artisan test
I get this: ERROR Call to a member function connection() on null
This is my tests/Pest.php
file:
uses(
TestsTestCase::class,
RefreshDatabase::class,
)->beforeEach(function () {
Artisan::call('migrate --force');
})->in('Feature');
The script that fails is located at tests/Feature/RouteApiTest.php
My Php Unit tests are passing. Pest is “blocked”.
The .env.testing
contains:
DB_CONNECTION=sqlite
DB_DATABASE=:memory:
APP_DEBUG=true
What am I missing?