diff --git a/tests/functional/Glpi/Features/Clonable.php b/tests/functional/Glpi/Features/Clonable.php index 3076ec92a96..4d4832eb3d7 100644 --- a/tests/functional/Glpi/Features/Clonable.php +++ b/tests/functional/Glpi/Features/Clonable.php @@ -72,8 +72,10 @@ public function testMassiveActionTargeting($class, $result) 'entities_id' => $this->getTestRootEntity(true), 'content' => '' ], ['content']); - $specific_actions = \MassiveAction::getAllMassiveActions($class, false, $item, $item->getID()); - $this->boolean(array_key_exists($ma_prefix . 'create_template', $specific_actions))->isIdenticalTo(true); + if ($item->maybeTemplate()) { + $specific_actions = \MassiveAction::getAllMassiveActions($class, false, $item, $item->getID()); + $this->boolean(array_key_exists($ma_prefix . 'create_template', $specific_actions))->isIdenticalTo(true); + } } } } diff --git a/tests/web/APIRest.php b/tests/web/APIRest.php index a4c16d32831..975745dec0f 100644 --- a/tests/web/APIRest.php +++ b/tests/web/APIRest.php @@ -2646,6 +2646,7 @@ protected function testGetMassiveActionsProvider(): array 'response' => [ ["key" => "MassiveAction:update", "label" => "Update"], ["key" => "MassiveAction:clone", "label" => "Clone"], + ["key" => "MassiveAction:create_template", "label" => "Create template"], ["key" => "Item_Line:add", "label" => "Add a line"], ["key" => "Item_Line:remove", "label" => "Remove a line"], ["key" => "Infocom:activate", "label" => "Enable the financial and administrative information"], @@ -2741,6 +2742,8 @@ protected function testGetMassiveActionParametersProvider(): array [ 'url' => 'getMassiveActionParameters/Computer/MassiveAction:create_template', 'status' => 400, + 'response' => [], + 'error' => "ERROR_MASSIVEACTION_KEY" ], [ 'url' => 'getMassiveActionParameters/Computer/Infocom:activate',