1717namespace taskflowadapter_ksw \usecases \competencies ;
1818
1919use advanced_testcase ;
20- use local_taskflow \local \external_adapter \external_api_base ;
2120use local_taskflow \local \external_adapter \external_api_repository ;
22- use local_taskflow \local \rules \rules ;
2321use tool_mocktesttime \time_mock ;
2422use context_system ;
2523use core_competency \api ;
@@ -177,7 +175,6 @@ public function test_assign_competency_on_option_completion(array $bdata): void
177175 // Not completed because wront competency was set on option.
178176 $ this ->assertSame ((int )$ assignment ->status , assignment_status_facade::get_status_identifier ('assigned ' ));
179177
180-
181178 // Forward to overdue.
182179 time_mock::set_mock_time (strtotime ('+ 31 days ' , time ()));
183180 $ plugingeneratortf ->runtaskswithintime ($ cronlock , $ lock , time ());
@@ -193,17 +190,16 @@ public function test_assign_competency_on_option_completion(array $bdata): void
193190 $ option1 ->competencies = $ competency ->get ('id ' );
194191 $ option1 = $ plugingenerator ->create_option ($ option1 );
195192
196- // Delete "old" assignment workaround.
197- // $DB->delete_records('local_taskflow_assignment', ['userid' => $user2->id ]);
198-
199193 // Save rule again.
200- $ event = rule_created_updated::create ([
194+ $ event = rule_created_updated::create (
195+ [
201196 'objectid ' => $ rule ['id ' ],
202197 'context ' => context_system::instance (),
203198 'other ' => [
204- 'ruledata ' => $ rule ,
205- ],
206- ]);
199+ 'ruledata ' => $ rule ,
200+ ],
201+ ]
202+ );
207203 $ event ->trigger ();
208204 $ plugingeneratortf ->runtaskswithintime ($ cronlock , $ lock , time ());
209205
0 commit comments