feat: add routes, lang, tests, stubs, docs, and docker configurations

This commit is contained in:
2026-05-21 16:05:16 +07:00
parent fad70d096b
commit 28a06315b8
3385 changed files with 177070 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
test('health endpoint returns 200 when no check fails', function () {
$response = $this->getJson('/api/health');
$response->assertOk()
->assertJsonStructure(['status', 'timestamp', 'checks' => ['database', 'storage', 'queue']]);
expect($response->json('status'))->toBeIn(['healthy', 'warn']);
});
test('health endpoint returns JSON with timestamp', function () {
$response = $this->getJson('/api/health');
$response->assertOk()->assertJsonStructure(['timestamp']);
expect($response->json('timestamp'))->toBeString();
});
test('health endpoint reports per-check status keys', function () {
$checks = $this->getJson('/api/health')->json('checks');
foreach (['database', 'redis', 'storage', 'queue'] as $key) {
expect($checks)->toHaveKey($key);
expect($checks[$key]['status'])->toBeIn(['ok', 'warn', 'fail', 'unknown']);
}
});