ldc-arcadia-api/tests/Feature/ErrorDocumentationTest.php
Jérémy Munsch d9329aca92
feat(errors): add detailed error documentation pages
- Implemented views for error codes 400, 404, 422, 429, 500, and 503.
- Updated error handling to use numeric codes instead of enum.
- Enhanced error messages and resolution steps for better user guidance.
2026-08-12 17:40:18 +02:00

35 lines
880 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Feature;
describe('Error Documentation Pages', function (): void {
it('renders the succinct documentation view for valid error codes', function (): void {
// GIVEN
/** @var \Tests\TestCase $test */
$test = $this;
$code = 404;
// WHEN
$response = $test->get("/errors/{$code}");
// THEN
$response->assertStatus(200);
$response->assertSee('Not Found');
$response->assertSee('404');
});
it('returns a 404 for an invalid 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);
});
});