File tree 2 files changed +6
-7
lines changed
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ public function definition(): array
16
16
{
17
17
return [
18
18
/** @phpstan-ignore-next-line */
19
- 'workflow_id ' => fn () => WorkflowFactory::new ()->create ()->id ,
19
+ 'workflow_id ' => fn () => WorkflowFactory::new ()->create ()->id ,
20
20
/** @phpstan-ignore-next-line */
21
- 'from_id ' => fn () => WorkflowStatusFactory::new ()->create ()->id ,
21
+ 'from_id ' => fn () => WorkflowStatusFactory::new ()->create ()->id ,
22
22
/** @phpstan-ignore-next-line */
23
- 'to_id ' => fn () => WorkflowStatusFactory::new ()->create ()->id ,
23
+ 'to_id ' => fn () => WorkflowStatusFactory::new ()->create ()->id ,
24
24
'order ' => random_int (1 , 999 ),
25
25
];
26
26
}
Original file line number Diff line number Diff line change 18
18
WorkflowTransitionFactory::new ()->workflow ($ workflow ->id )->from ($ mid1 ->to_id )->exit ()->create ();
19
19
WorkflowTransitionFactory::new ()->workflow ($ workflow ->id )->from ($ mid2 ->to_id )->exit ()->create ();
20
20
21
-
22
21
$ this ->secondaryWorkflow = $ workflow = WorkflowFactory::new ()->create ();
23
22
WorkflowTransitionFactory::new ()->workflow ($ this ->secondaryWorkflow ->id )->entry ()->create ();
24
23
});
97
96
});
98
97
99
98
test ('it deletes model statuses when model is deleted ' , function () {
100
- ($ model = new WorkflowableModel () )->setDefaultWorkflowName ($ this ->workflow ->name )->save ();
99
+ ($ model = new WorkflowableModel )->setDefaultWorkflowName ($ this ->workflow ->name )->save ();
101
100
expect (WorkflowModelStatus::count ())->toBe (1 );
102
101
103
102
$ model ->delete ();
104
103
expect (WorkflowModelStatus::count ())->toBe (0 );
105
104
});
106
105
107
106
test ('it queries by workflow ' , function () {
108
- ($ model = new WorkflowableModel () )->setDefaultWorkflowName ($ this ->workflow ->name )->save ();
107
+ ($ model = new WorkflowableModel )->setDefaultWorkflowName ($ this ->workflow ->name )->save ();
109
108
110
109
expect (WorkflowableModel::query ()->inWorkflow ($ this ->workflow ->name )->count ())->toBe (1 )
111
- ->and (WorkflowableModel::query ()->inWorkflow ($ this ->secondaryWorkflow ->name )->count ())->toBe (0 );
110
+ ->and (WorkflowableModel::query ()->inWorkflow ($ this ->secondaryWorkflow ->name )->count ())->toBe (0 );
112
111
});
113
112
114
113
test ('it has toString ' , function () {
You can’t perform that action at this time.
0 commit comments