diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-03-20 09:53:51 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-03-20 09:53:51 +0000 |
| commit | 45cd4aadbecce5840ab5dd56c0aad3c9807269fb (patch) | |
| tree | a71cf92b904257a4deffbd0cdd5853e516cc0e49 /tests | |
| parent | 146853225818d55c9d8a061cfcda1f65724ffa09 (diff) | |
add block length to lock time, fixes #2398
Closes #2398
Merge request studip/studip!1589
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/jsonapi/ConsultationHelper.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/jsonapi/ConsultationHelper.php b/tests/jsonapi/ConsultationHelper.php index 10d5050..a46cb47 100644 --- a/tests/jsonapi/ConsultationHelper.php +++ b/tests/jsonapi/ConsultationHelper.php @@ -43,12 +43,14 @@ trait ConsultationHelper protected function createBlockWithSlotsForRange(Range $range, bool $lock_blocks = false): ConsultationBlock { + $slot_length_in_hours = 2; + // Generate start and end time. Assures that the day is not a holiday. $now = time(); do { $begin = strtotime('next monday 8:00:00', $now); - $end = strtotime('+2 hours', $begin); + $end = strtotime("+{$slot_length_in_hours} hours", $begin); $now = strtotime('+1 week', $now); @@ -58,7 +60,7 @@ trait ConsultationHelper // Lock blocks? $additional_data = []; if ($lock_blocks) { - $additional_data['lock_time'] = ceil(($begin - time()) / 3600); + $additional_data['lock_time'] = ceil(($begin - time()) / 3600) + $slot_length_in_hours; } // Generate blocks |
