From b6f5f777815cfde22a3d3c67fbd1bf64db1936f9 Mon Sep 17 00:00:00 2001 From: Constantin Graf Date: Sun, 19 May 2024 12:04:25 +0200 Subject: [PATCH] Added healthcheck endpoint tests --- .../Endpoint/Web/HealthCheckEndpointTest.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/Unit/Endpoint/Web/HealthCheckEndpointTest.php diff --git a/tests/Unit/Endpoint/Web/HealthCheckEndpointTest.php b/tests/Unit/Endpoint/Web/HealthCheckEndpointTest.php new file mode 100644 index 00000000..8827f83d --- /dev/null +++ b/tests/Unit/Endpoint/Web/HealthCheckEndpointTest.php @@ -0,0 +1,39 @@ +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', + ]); + } +}