File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function formattedMessage(): string
53
53
*/
54
54
public function scopeIncomplete (Builder $ query ): Builder
55
55
{
56
- return $ query ->whereIn ('status ' , [ ScheduleStatusEnum::incomplete ()] )
56
+ return $ query ->whereIn ('status ' , ScheduleStatusEnum::incomplete ())
57
57
->whereNull ('completed_at ' );
58
58
}
59
59
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ use Cachet \Enums \ScheduleStatusEnum ;
3
4
use Cachet \Models \Schedule ;
4
5
use Cachet \Models \ScheduleComponent ;
5
6
15
16
->components ->toHaveCount (2 );
16
17
});
17
18
19
+ it ('can get incomplete schedules ' , function () {
20
+ [$ scheduleA , ] = Schedule::factory ()
21
+ ->count (3 )
22
+ ->sequence (
23
+ ['status ' => ScheduleStatusEnum::in_progress],
24
+ ['status ' => ScheduleStatusEnum::upcoming],
25
+ ['status ' => ScheduleStatusEnum::complete],
26
+ )
27
+ ->create ();
28
+
29
+ expect (Schedule::query ()->incomplete ()->get ())
30
+ ->toHaveCount (2 )
31
+ ->first ()->id ->toBe ($ scheduleA ->id );
32
+ });
33
+
18
34
it ('can get in-progress schedules ' , function () {
19
35
$ schedule = Schedule::factory ()->inThePast ()->create ();
20
36
$ scheduleInProgress = Schedule::factory ()->inProgress ()->create ();
You can’t perform that action at this time.
0 commit comments