false, 'session.driver' => 'array', 'cache.default' => 'array', 'mail.default' => 'array', ]); /** * Feature tests post directly to web routes. Keep CSRF enabled in the * application, but exclude it in PHPUnit so tests exercise validation, * authorization, tenancy and persistence instead of failing with 419. */ if (class_exists(ValidateCsrfToken::class)) { ValidateCsrfToken::except(['*']); $this->withoutMiddleware(ValidateCsrfToken::class); } if (class_exists(\App\Http\Middleware\VerifyCsrfToken::class)) { \App\Http\Middleware\VerifyCsrfToken::except(['*']); $this->withoutMiddleware(\App\Http\Middleware\VerifyCsrfToken::class); } } /** * POST with a real CSRF token for tests that intentionally verify web-form behaviour. * * @param array $data */ protected function csrfPost(string $uri, array $data = []): TestResponse { $token = 'test-csrf-token'; return $this->withSession(['_token' => $token]) ->post($uri, ['_token' => $token, ...$data]); } protected function skipUnlessFortifyHas(string $feature, ?string $message = null): void { if (! Features::enabled($feature)) { $this->markTestSkipped($message ?? "Fortify feature [{$feature}] is not enabled."); } } }