seed(ContentSeeder::class); View::share('PageList', Page::getCached() ->mapWithKeys(fn ($page) => [ $page->slug->value() => $page, ])); Cache::flush(); // WHEN $response = $this->get('/commande/panier'); // THEN $response->assertRedirectToRoute('fo.auth.connexion'); }); it('redirects unauthenticated guest submitting basket summary to login', function (): void { // GIVEN $this->seed(ContentSeeder::class); View::share('PageList', Page::getCached() ->mapWithKeys(fn ($page) => [ $page->slug->value() => $page, ])); Cache::flush(); // WHEN $response = $this->post('/commande/panier', []); // THEN $response->assertRedirectToRoute('fo.auth.connexion'); }); it('redirects unauthenticated guest accessing pick time slot to login', function (): void { // GIVEN $this->seed(ContentSeeder::class); View::share('PageList', Page::getCached() ->mapWithKeys(fn ($page) => [ $page->slug->value() => $page, ])); Cache::flush(); // WHEN $response = $this->get('/commande/creneaux'); // THEN $response->assertRedirectToRoute('fo.auth.connexion'); }); it('redirects unauthenticated guest submitting pick time slot to login', function (): void { // GIVEN $this->seed(ContentSeeder::class); View::share('PageList', Page::getCached() ->mapWithKeys(fn ($page) => [ $page->slug->value() => $page, ])); Cache::flush(); // WHEN $response = $this->post('/commande/creneaux', []); // THEN $response->assertRedirectToRoute('fo.auth.connexion'); }); it('redirects unauthenticated guest accessing confirmation to login', function (): void { // GIVEN $this->seed(ContentSeeder::class); View::share('PageList', Page::getCached() ->mapWithKeys(fn ($page) => [ $page->slug->value() => $page, ])); Cache::flush(); // WHEN $response = $this->get('/commande/confirmation'); // THEN $response->assertRedirectToRoute('fo.auth.connexion'); }); it('redirects unauthenticated guest submitting confirmation to login', function (): void { // GIVEN $this->seed(ContentSeeder::class); View::share('PageList', Page::getCached() ->mapWithKeys(fn ($page) => [ $page->slug->value() => $page, ])); Cache::flush(); // WHEN $response = $this->post('/commande/confirmation', []); // THEN $response->assertRedirectToRoute('fo.auth.connexion'); }); it('redirects unauthenticated guest accessing confirmed order to login', function (): void { // GIVEN $this->seed(ContentSeeder::class); View::share('PageList', Page::getCached() ->mapWithKeys(fn ($page) => [ $page->slug->value() => $page, ])); Cache::flush(); // WHEN $response = $this->get('/commande/confirmation/1'); // THEN $response->assertRedirectToRoute('fo.auth.connexion'); }); });