Skip to content

Commit

Permalink
FIx
Browse files Browse the repository at this point in the history
  • Loading branch information
ddurieux committed Apr 11, 2024
1 parent e732fa4 commit 1de016c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion inc/deployuserinteraction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
];
}
Expand Down
5 changes: 2 additions & 3 deletions tests/Unit/Deploy/DeployUserinteractionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];

Expand All @@ -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);

}


Expand Down

0 comments on commit 1de016c

Please sign in to comment.