fix: harden sessions and domain validation

This commit is contained in:
Marco0300
2026-09-01 18:58:18 +02:00
parent 480494c5ed
commit 9f5142b071
9 changed files with 40 additions and 16 deletions
+3
View File
@@ -13,6 +13,9 @@ if (calculate_duration_hours(null, null, 1.25) !== 1.25) {
if (calculate_duration_hours('11:30', '09:00') !== null) {
throw new RuntimeException('Expected invalid reverse time to be rejected');
}
if (calculate_duration_hours(null, null, 0.0) !== null) {
throw new RuntimeException('Expected zero manual hours to be rejected');
}
$sla = calculate_sla_usage(20.0, [2.0, 1.5, 1.0]);
if ($sla !== ['used' => 4.5, 'remaining' => 15.5, 'percentage' => 22.5, 'status' => 'within_limit']) {
throw new RuntimeException('Unexpected SLA calculation: ' . json_encode($sla));