diff --git a/inc/deployuserinteraction.class.php b/inc/deployuserinteraction.class.php index 96d95c8cd..b15296f06 100644 --- a/inc/deployuserinteraction.class.php +++ b/inc/deployuserinteraction.class.php @@ -356,10 +356,10 @@ function check_data_from_form() { return [ 'id' => intval($id), - 'type' => $type, 'name' => $name, 'title' => $title, 'text' => str_replace('\r\n', PluginFusioninventoryDeployUserinteraction::RN_TRANSFORMATION, $text), + 'type' => $type, 'template' => intval($template) ]; } diff --git a/tests/Unit/Deploy/DeployUserinteractionTest.php b/tests/Unit/Deploy/DeployUserinteractionTest.php index 40211500a..bd766845e 100644 --- a/tests/Unit/Deploy/DeployUserinteractionTest.php +++ b/tests/Unit/Deploy/DeployUserinteractionTest.php @@ -184,10 +184,10 @@ public function testAdd_item() { $interaction = new PluginFusioninventoryDeployUserinteraction(); $params = ['id' => intval($packages_id), - 'type' => 'before', 'name' => 'interaction 1', 'title' => 'My title', 'text' => 'my text', + 'type' => 'before', 'template' => 0, ]; @@ -197,17 +197,16 @@ public function testAdd_item() { $this->assertEquals($expected, $json); $params = ['id' => intval($packages_id), - 'type' => 'after', 'name' => 'interaction 2', 'title' => 'My title', 'text' => 'my text', + 'type' => 'after', 'template' => 0, ]; $interaction->add_item($params); $expected = '{"jobs":{"checks":[],"associatedFiles":[],"actions":[],"userinteractions":[{"name":"interaction 1","title":"My title","text":"my text","type":"before","template":0},{"name":"interaction 2","title":"My title","text":"my text","type":"after","template":0}]},"associatedFiles":[]}'; $json = Toolbox::stripslashes_deep($interaction->getJson($packages_id)); $this->assertEquals($expected, $json); - }