init
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
class HealthTest extends TestCase
|
||||
{
|
||||
public function test_health_returns_the_standard_envelope(): void
|
||||
{
|
||||
$response = $this->getJson('/api/v1/health');
|
||||
|
||||
$response->assertOk()
|
||||
->assertExactJson([
|
||||
'success' => true,
|
||||
'message' => 'OK',
|
||||
'data' => [
|
||||
'status' => 'ok',
|
||||
],
|
||||
]);
|
||||
|
||||
$response->assertHeader('X-Request-Id');
|
||||
}
|
||||
|
||||
public function test_health_keeps_a_valid_request_id(): void
|
||||
{
|
||||
$response = $this->withHeader('X-Request-Id', 'req_123')
|
||||
->getJson('/api/v1/health');
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertHeader('X-Request-Id', 'req_123');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user