@@ -70,11 +70,11 @@ public function test_add_step(): void {
7070 $ this ->workflow ->id );
7171 $ this ->assertNotEmpty ($ step ->id );
7272 $ this ->assertEquals ($ this ->workflow ->id , $ step ->workflowid );
73- $ this ->assertEquals (1 , $ step ->sortindex );
73+ $ this ->assertEquals (2 , $ step ->sortindex );
7474 }
7575
7676 /**
77- * Test that sortindizes are created correclty when creating multiple steps.
77+ * Test that sort indices are created correctly when creating multiple steps.
7878 * @covers \tool_lifecycle\local\manager\step_manager
7979 */
8080 public function test_add_multiple_steps (): void {
@@ -90,9 +90,9 @@ public function test_add_multiple_steps(): void {
9090 'instance3 ' ,
9191 'subpluginname ' ,
9292 $ this ->workflow ->id );
93- $ this ->assertEquals (1 , $ step1 ->sortindex );
94- $ this ->assertEquals (2 , $ step2 ->sortindex );
95- $ this ->assertEquals (3 , $ step3 ->sortindex );
93+ $ this ->assertEquals (2 , $ step1 ->sortindex );
94+ $ this ->assertEquals (3 , $ step2 ->sortindex );
95+ $ this ->assertEquals (4 , $ step3 ->sortindex );
9696 }
9797
9898 /**
@@ -118,14 +118,14 @@ public function test_remove_step(): void {
118118 $ step2 = step_manager::get_step_instance ($ step2 ->id );
119119 $ step3 = step_manager::get_step_instance ($ step3 ->id );
120120 $ this ->assertNull ($ step1 );
121- $ this ->assertEquals (1 , $ step2 ->sortindex );
122- $ this ->assertEquals (2 , $ step3 ->sortindex );
121+ $ this ->assertEquals (2 , $ step2 ->sortindex );
122+ $ this ->assertEquals (3 , $ step3 ->sortindex );
123123 // Delete third step.
124124 step_manager::handle_action (action::STEP_INSTANCE_DELETE , $ step3 ->id , $ this ->workflow ->id );
125125 $ step3 = step_manager::get_step_instance ($ step3 ->id );
126126 $ step2 = step_manager::get_step_instance ($ step2 ->id );
127127 $ this ->assertNull ($ step3 );
128- $ this ->assertEquals (1 , $ step2 ->sortindex );
128+ $ this ->assertEquals (2 , $ step2 ->sortindex );
129129 }
130130
131131 /**
@@ -154,8 +154,8 @@ public function test_add_after_remove_step(): void {
154154 $ step2 = step_manager::get_step_instance ($ step2 ->id );
155155 $ step3 = step_manager::get_step_instance ($ step3 ->id );
156156 $ this ->assertNull ($ step1 );
157- $ this ->assertEquals (1 , $ step2 ->sortindex );
158- $ this ->assertEquals (2 , $ step3 ->sortindex );
157+ $ this ->assertEquals (2 , $ step2 ->sortindex );
158+ $ this ->assertEquals (3 , $ step3 ->sortindex );
159159 }
160160
161161}
0 commit comments