Added healthcheck endpoint tests

This commit is contained in:
Constantin Graf
2024-05-19 12:04:25 +02:00
parent b44f3fa066
commit b6f5f77781

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace Tests\Unit\Endpoint\Web;
class HealthCheckEndpointTest extends EndpointTestAbstract
{
public function test_up_endpoint_returns_ok(): void
{
// Act
$response = $this->get('health-check/up');
// Assert
$response->assertSuccessful();
$response->assertExactJson([
'success' => true,
]);
}
public function test_debug_endpoint_returns_ok(): void
{
// Act
$response = $this->get('health-check/debug');
// Assert
$response->assertSuccessful();
$response->assertJsonStructure([
'ip_address',
'hostname',
'timestamp',
'date_time_utc',
'date_time_app',
'timezone',
'secure',
'is_trusted_proxy',
]);
}
}