/** * @test */ public function getCollectURLRootEntity() { global $DB; $DB->connect(); $_SESSION['glpiactive_entity'] = 0; $_SESSION["plugin_fusioninventory_entity"] = 0; $_SESSION["glpiname"] = 'Plugin_FusionInventory'; $entities_id = 1; $agents_id = 1; $config = new PluginFusioninventoryConfig(); $config->loadCache(); $pfEntity = new PluginFusioninventoryEntity(); $pfEntity->delete(array('id' => 2)); // Get answer $input = array('action' => 'getConfig', 'task' => array('COLLECT' => '1.0.0'), 'machineid' => 'toto-device'); $response = PluginFusioninventoryCommunicationRest::communicate($input); $this->assertEquals('http://127.0.0.1/glpi085/plugins/fusioninventory/b/collect/', $response['schedule'][0]['remote'], 'Wrong URL'); }
/** * Manage REST parameters **/ static function handleFusionCommunication() { $response = PluginFusioninventoryCommunicationRest::communicate($_GET); if ($response) { echo json_encode($response); } else { PluginFusioninventoryCommunicationRest::sendError(); } }