Skip to content

Commit 005c3d3

Browse files
committed
chore: cover with more scenarios
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 6c75dac commit 005c3d3

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

tests/php/Unit/Service/ReminderServiceTest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,38 @@ public static function providerWillNotify(): array {
140140
],
141141
'now' => $now, 'daysBefore' => 1, 'daysBetween' => 1, 'max' => 0, false,
142142
],
143+
'no notification, scheduled for today, between = 0' => [
144+
[
145+
'first' => (clone $now),
146+
'last' => (clone $now),
147+
'total' => 1,
148+
],
149+
'now' => $now, 'daysBefore' => 1, 'daysBetween' => 0, 'max' => 5, false,
150+
],
151+
'no notification, scheduled for today, between = 1' => [
152+
[
153+
'first' => (clone $now),
154+
'last' => (clone $now),
155+
'total' => 1,
156+
],
157+
'now' => $now, 'daysBefore' => 1, 'daysBetween' => 1, 'max' => 5, false,
158+
],
159+
'no notification, scheduled for yesterday, between = 0' => [
160+
[
161+
'first' => (clone $now)->modify('-1 day'),
162+
'last' => (clone $now)->modify('-1 day'),
163+
'total' => 1,
164+
],
165+
'now' => $now, 'daysBefore' => 1, 'daysBetween' => 0, 'max' => 5, false,
166+
],
167+
'one notification, scheduled for yesterday, between = 1' => [
168+
[
169+
'first' => (clone $now)->modify('-1 day'),
170+
'last' => (clone $now)->modify('-1 day'),
171+
'total' => 1,
172+
],
173+
'now' => $now, 'daysBefore' => 1, 'daysBetween' => 1, 'max' => 5, false,
174+
],
143175
'one notification, should send' => [
144176
[
145177
'first' => (clone $now)->modify('-2 days'),

0 commit comments

Comments
 (0)