ldc-arcadia-api/tests/Feature/OpenApi/V1/Health/HealthOpenApiTest.php

29 lines
758 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Feature\OpenApi\V1\Health;
use Spectator\Spectator;
use Tests\TestCase;
beforeEach(function (): void {
Spectator::reset();
Spectator::using('openapi.yaml');
});
describe('Health Check OpenAPI Conformance', function (): void {
it('validates GET /api/v1/health response against openapi spec', function (): void {
// GIVEN
/** @var TestCase $this */
// WHEN
/** @var \Illuminate\Testing\TestResponse<\Symfony\Component\HttpFoundation\Response> $response */
$response = $this->getJson('/api/v1/health');
// THEN
$response->assertStatus(200);
$response->assertValidRequest();
$response->assertValidResponse(200);
});
});