@@ -21,56 +21,56 @@ public function it_can_execute_a_complete_workflow(): void
2121 'action ' => 'log ' ,
2222 'parameters ' => [
2323 'message ' => 'Welcome {{name}} to our platform! ' ,
24- 'level ' => 'info '
25- ]
24+ 'level ' => 'info ' ,
25+ ],
2626 ],
2727 [
28- 'id ' => 'setup_profile ' ,
28+ 'id ' => 'setup_profile ' ,
2929 'name ' => 'Setup User Profile ' ,
3030 'action ' => 'log ' ,
3131 'parameters ' => [
3232 'message ' => 'Setting up profile for {{name}} with email {{email}} ' ,
33- 'level ' => 'info '
34- ]
33+ 'level ' => 'info ' ,
34+ ],
3535 ],
3636 [
3737 'id ' => 'send_confirmation ' ,
3838 'name ' => 'Send Confirmation ' ,
3939 'action ' => 'log ' ,
4040 'parameters ' => [
4141 'message ' => 'Sending confirmation email to {{email}} ' ,
42- 'level ' => 'info '
43- ]
44- ]
42+ 'level ' => 'info ' ,
43+ ],
44+ ],
4545 ],
4646 'transitions ' => [
4747 [
4848 'from ' => 'welcome ' ,
49- 'to ' => 'setup_profile '
49+ 'to ' => 'setup_profile ' ,
5050 ],
5151 [
5252 'from ' => 'setup_profile ' ,
53- 'to ' => 'send_confirmation '
54- ]
55- ]
53+ 'to ' => 'send_confirmation ' ,
54+ ],
55+ ],
5656 ];
5757
5858 $ context = [
5959 'name ' => 'John Doe ' ,
6060 'email ' => 'john@example.com ' ,
61- 'userId ' => 123
61+ 'userId ' => 123 ,
6262 ];
6363
6464 // Start the workflow using helper function
6565 $ workflowId = start_workflow ('user-onboarding-123 ' , $ definition , $ context );
66-
66+
6767 // Verify workflow was created and completed
6868 $ this ->assertNotEmpty ($ workflowId );
6969 $ this ->assertEquals ('user-onboarding-123 ' , $ workflowId );
7070
7171 // Get workflow instance using helper
7272 $ instance = get_workflow ($ workflowId );
73-
73+
7474 // Verify the workflow completed successfully
7575 $ this ->assertEquals (WorkflowState::COMPLETED , $ instance ->getState ());
7676 $ this ->assertEquals ('User Onboarding Workflow ' , $ instance ->getName ());
@@ -80,13 +80,13 @@ public function it_can_execute_a_complete_workflow(): void
8080 $ this ->assertEquals ('John Doe ' , $ workflowData ['name ' ]);
8181 $ this ->assertEquals ('john@example.com ' , $ workflowData ['email ' ]);
8282 $ this ->assertEquals (123 , $ workflowData ['userId ' ]);
83-
83+
8484 // Verify that all steps completed successfully
8585 $ this ->assertCount (3 , $ instance ->getCompletedSteps ());
8686 $ this ->assertContains ('welcome ' , $ instance ->getCompletedSteps ());
8787 $ this ->assertContains ('setup_profile ' , $ instance ->getCompletedSteps ());
8888 $ this ->assertContains ('send_confirmation ' , $ instance ->getCompletedSteps ());
89-
89+
9090 // Verify no failed steps
9191 $ this ->assertEmpty ($ instance ->getFailedSteps ());
9292
@@ -107,17 +107,17 @@ public function it_can_handle_workflow_cancellation(): void
107107 'id ' => 'step1 ' ,
108108 'name ' => 'First Step ' ,
109109 'action ' => 'log ' ,
110- 'parameters ' => ['message ' => 'Starting process ' ]
111- ]
112- ]
110+ 'parameters ' => ['message ' => 'Starting process ' ],
111+ ],
112+ ],
113113 ];
114114
115115 // Start workflow
116116 $ workflowId = start_workflow ('cancellable-workflow ' , $ definition );
117-
117+
118118 // Cancel workflow
119119 cancel_workflow ($ workflowId , 'User requested cancellation ' );
120-
120+
121121 // Verify cancellation
122122 $ instance = get_workflow ($ workflowId );
123123 $ this ->assertEquals (WorkflowState::CANCELLED , $ instance ->getState ());
@@ -129,21 +129,21 @@ public function it_can_list_and_filter_workflows(): void
129129 $ definition1 = [
130130 'name ' => 'Workflow 1 ' ,
131131 'steps ' => [
132- ['id ' => 'step1 ' , 'action ' => 'log ' , 'parameters ' => ['message ' => 'Test ' ]]
133- ]
132+ ['id ' => 'step1 ' , 'action ' => 'log ' , 'parameters ' => ['message ' => 'Test ' ]],
133+ ],
134134 ];
135135
136136 $ definition2 = [
137137 'name ' => 'Workflow 2 ' ,
138138 'steps ' => [
139- ['id ' => 'step1 ' , 'action ' => 'log ' , 'parameters ' => ['message ' => 'Test ' ]]
140- ]
139+ ['id ' => 'step1 ' , 'action ' => 'log ' , 'parameters ' => ['message ' => 'Test ' ]],
140+ ],
141141 ];
142142
143143 // Start two workflows
144144 $ workflow1Id = start_workflow ('list-test-1 ' , $ definition1 );
145145 $ workflow2Id = start_workflow ('list-test-2 ' , $ definition2 );
146-
146+
147147 // Cancel one
148148 cancel_workflow ($ workflow2Id );
149149
@@ -157,11 +157,11 @@ public function it_can_list_and_filter_workflows(): void
157157
158158 $ this ->assertGreaterThanOrEqual (1 , count ($ completedWorkflows ));
159159 $ this ->assertGreaterThanOrEqual (1 , count ($ cancelledWorkflows ));
160-
160+
161161 // Verify specific workflows exist in filtered results
162162 $ completedIds = array_column ($ completedWorkflows , 'workflow_id ' );
163163 $ cancelledIds = array_column ($ cancelledWorkflows , 'workflow_id ' );
164-
164+
165165 $ this ->assertContains ($ workflow1Id , $ completedIds );
166166 $ this ->assertContains ($ workflow2Id , $ cancelledIds );
167167 }
@@ -179,64 +179,64 @@ public function it_can_execute_conditional_workflows(): void
179179 'action ' => 'log ' ,
180180 'parameters ' => [
181181 'message ' => 'Validating request from {{user}} ' ,
182- 'level ' => 'info '
183- ]
182+ 'level ' => 'info ' ,
183+ ],
184184 ],
185185 [
186186 'id ' => 'auto_approve ' ,
187187 'name ' => 'Auto Approve ' ,
188188 'action ' => 'log ' ,
189189 'parameters ' => [
190190 'message ' => 'Auto-approving request for premium user {{user}} ' ,
191- 'level ' => 'info '
192- ]
191+ 'level ' => 'info ' ,
192+ ],
193193 ],
194194 [
195195 'id ' => 'manual_review ' ,
196196 'name ' => 'Manual Review Required ' ,
197197 'action ' => 'log ' ,
198198 'parameters ' => [
199199 'message ' => 'Manual review required for user {{user}} ' ,
200- 'level ' => 'warning '
201- ]
200+ 'level ' => 'warning ' ,
201+ ],
202202 ],
203203 [
204204 'id ' => 'notify_completion ' ,
205205 'name ' => 'Notify Completion ' ,
206206 'action ' => 'log ' ,
207207 'parameters ' => [
208208 'message ' => 'Process completed for {{user}} ' ,
209- 'level ' => 'info '
210- ]
211- ]
209+ 'level ' => 'info ' ,
210+ ],
211+ ],
212212 ],
213213 'transitions ' => [
214214 [
215215 'from ' => 'validate_request ' ,
216216 'to ' => 'auto_approve ' ,
217- 'condition ' => 'tier === premium '
217+ 'condition ' => 'tier === premium ' ,
218218 ],
219219 [
220220 'from ' => 'validate_request ' ,
221221 'to ' => 'manual_review ' ,
222- 'condition ' => 'tier !== premium '
222+ 'condition ' => 'tier !== premium ' ,
223223 ],
224224 [
225225 'from ' => 'auto_approve ' ,
226- 'to ' => 'notify_completion '
226+ 'to ' => 'notify_completion ' ,
227227 ],
228228 [
229229 'from ' => 'manual_review ' ,
230- 'to ' => 'notify_completion '
231- ]
232- ]
230+ 'to ' => 'notify_completion ' ,
231+ ],
232+ ],
233233 ];
234234
235235 // Test premium user path (should auto-approve)
236236 $ premiumContext = [
237237 'user ' => 'Alice Premium ' ,
238238 'tier ' => 'premium ' ,
239- 'amount ' => 1000
239+ 'amount ' => 1000 ,
240240 ];
241241
242242 $ premiumWorkflowId = start_workflow ('premium-approval-123 ' , $ definition , $ premiumContext );
@@ -253,7 +253,7 @@ public function it_can_execute_conditional_workflows(): void
253253 $ regularContext = [
254254 'user ' => 'Bob Regular ' ,
255255 'tier ' => 'basic ' ,
256- 'amount ' => 5000
256+ 'amount ' => 5000 ,
257257 ];
258258
259259 $ regularWorkflowId = start_workflow ('regular-approval-456 ' , $ definition , $ regularContext );
0 commit comments