22
33namespace Tests \Model ;
44
5- use DOMXPath ;
6- use Mockery ;
75use ProcessMaker \Models \Group ;
86use ProcessMaker \Models \GroupMember ;
97use ProcessMaker \Models \Process ;
108use ProcessMaker \Models \ProcessRequest ;
119use ProcessMaker \Models \ProcessRequestToken ;
1210use ProcessMaker \Models \User ;
13- use ProcessMaker \Nayra \Storage \BpmnDocument ;
1411use stdClass ;
1512use Tests \TestCase ;
1613
@@ -69,6 +66,7 @@ public function testGetUsersFromProcessVariableWithDirectUsers()
6966 if ($ key === 'assignedGroups ' ) {
7067 return null ;
7168 }
69+
7270 return $ default ;
7371 });
7472
@@ -79,12 +77,12 @@ public function testGetUsersFromProcessVariableWithDirectUsers()
7977 $ token = $ this ->getMockBuilder (ProcessRequestToken::class)
8078 ->onlyMethods (['getBpmnDefinition ' ])
8179 ->getMock ();
82-
80+
8381 $ token ->process_id = $ process ->id ;
8482 $ token ->process_request_id = $ request ->id ;
8583 $ token ->element_id = 'task_1 ' ;
8684 $ token ->process = $ process ;
87-
85+
8886 $ token ->expects ($ this ->atLeastOnce ())
8987 ->method ('getBpmnDefinition ' )
9088 ->willReturn ($ bpmnDefinition );
@@ -147,6 +145,7 @@ public function testGetUsersFromProcessVariableWithGroups()
147145 if ($ key === 'assignedGroups ' ) {
148146 return 'assigned_groups_var ' ;
149147 }
148+
150149 return $ default ;
151150 });
152151
@@ -157,12 +156,12 @@ public function testGetUsersFromProcessVariableWithGroups()
157156 $ token = $ this ->getMockBuilder (ProcessRequestToken::class)
158157 ->onlyMethods (['getBpmnDefinition ' ])
159158 ->getMock ();
160-
159+
161160 $ token ->process_id = $ process ->id ;
162161 $ token ->process_request_id = $ request ->id ;
163162 $ token ->element_id = 'task_1 ' ;
164163 $ token ->process = $ process ;
165-
164+
166165 $ token ->expects ($ this ->atLeastOnce ())
167166 ->method ('getBpmnDefinition ' )
168167 ->willReturn ($ bpmnDefinition );
@@ -215,6 +214,7 @@ public function testGetUsersFromProcessVariableWithUsersAndGroups()
215214 if ($ key === 'assignedGroups ' ) {
216215 return 'assigned_groups_var ' ;
217216 }
217+
218218 return $ default ;
219219 });
220220
@@ -225,12 +225,12 @@ public function testGetUsersFromProcessVariableWithUsersAndGroups()
225225 $ token = $ this ->getMockBuilder (ProcessRequestToken::class)
226226 ->onlyMethods (['getBpmnDefinition ' ])
227227 ->getMock ();
228-
228+
229229 $ token ->process_id = $ process ->id ;
230230 $ token ->process_request_id = $ request ->id ;
231231 $ token ->element_id = 'task_1 ' ;
232232 $ token ->process = $ process ;
233-
233+
234234 $ token ->expects ($ this ->atLeastOnce ())
235235 ->method ('getBpmnDefinition ' )
236236 ->willReturn ($ bpmnDefinition );
@@ -270,6 +270,7 @@ public function testGetUsersFromProcessVariableWithEmptyFormData()
270270 if ($ key === 'assignedGroups ' ) {
271271 return 'assigned_groups_var ' ;
272272 }
273+
273274 return $ default ;
274275 });
275276
@@ -280,12 +281,12 @@ public function testGetUsersFromProcessVariableWithEmptyFormData()
280281 $ token = $ this ->getMockBuilder (ProcessRequestToken::class)
281282 ->onlyMethods (['getBpmnDefinition ' ])
282283 ->getMock ();
283-
284+
284285 $ token ->process_id = $ process ->id ;
285286 $ token ->process_request_id = $ request ->id ;
286287 $ token ->element_id = 'task_1 ' ;
287288 $ token ->process = $ process ;
288-
289+
289290 $ token ->expects ($ this ->atLeastOnce ())
290291 ->method ('getBpmnDefinition ' )
291292 ->willReturn ($ bpmnDefinition );
@@ -320,6 +321,7 @@ public function testGetUsersFromProcessVariableWithNonArrayValues()
320321 if ($ key === 'assignedGroups ' ) {
321322 return 'assigned_groups_var ' ;
322323 }
324+
323325 return $ default ;
324326 });
325327
@@ -330,12 +332,12 @@ public function testGetUsersFromProcessVariableWithNonArrayValues()
330332 $ token = $ this ->getMockBuilder (ProcessRequestToken::class)
331333 ->onlyMethods (['getBpmnDefinition ' ])
332334 ->getMock ();
333-
335+
334336 $ token ->process_id = $ process ->id ;
335337 $ token ->process_request_id = $ request ->id ;
336338 $ token ->element_id = 'task_1 ' ;
337339 $ token ->process = $ process ;
338-
340+
339341 $ token ->expects ($ this ->atLeastOnce ())
340342 ->method ('getBpmnDefinition ' )
341343 ->willReturn ($ bpmnDefinition );
@@ -376,6 +378,7 @@ public function testGetUsersFromProcessVariableFiltersInvalidIds()
376378 if ($ key === 'assignedGroups ' ) {
377379 return null ;
378380 }
381+
379382 return $ default ;
380383 });
381384
@@ -386,12 +389,12 @@ public function testGetUsersFromProcessVariableFiltersInvalidIds()
386389 $ token = $ this ->getMockBuilder (ProcessRequestToken::class)
387390 ->onlyMethods (['getBpmnDefinition ' ])
388391 ->getMock ();
389-
392+
390393 $ token ->process_id = $ process ->id ;
391394 $ token ->process_request_id = $ request ->id ;
392395 $ token ->element_id = 'task_1 ' ;
393396 $ token ->process = $ process ;
394-
397+
395398 $ token ->expects ($ this ->atLeastOnce ())
396399 ->method ('getBpmnDefinition ' )
397400 ->willReturn ($ bpmnDefinition );
0 commit comments