mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-15 11:42:15 +01:00
Added healthcheck endpoint tests
This commit is contained in:
39
tests/Unit/Endpoint/Web/HealthCheckEndpointTest.php
Normal file
39
tests/Unit/Endpoint/Web/HealthCheckEndpointTest.php
Normal 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',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user