get("/errors/{$code}"); // THEN $response->assertStatus(200); $response->assertSee($expectedTitle); $response->assertSee((string) $code); $response->assertSee('Conforme à la spécification RFC 7807 Problem Details'); })->with([400, 404, 422, 429, 500, 503]); it('returns a 404 when requesting documentation for an unsupported error code', function (int $code): void { // GIVEN /** @var \Tests\TestCase $test */ $test = $this; // WHEN $response = $test->get("/errors/{$code}"); // THEN $response->assertStatus(404); })->with([0, 418, 999]); it('returns a 404 for a non-numeric error code slug', function (): void { // GIVEN /** @var \Tests\TestCase $test */ $test = $this; $invalidSlug = 'non-existing-error-code'; // WHEN $response = $test->get("/errors/{$invalidSlug}"); // THEN $response->assertStatus(404); }); });