diff --git a/php/WebServices/Tests/Suite/TestGetPlot_50.php b/php/WebServices/Tests/Suite/TestGetPlot_50.php new file mode 100644 index 0000000..bf98eee --- /dev/null +++ b/php/WebServices/Tests/Suite/TestGetPlot_50.php @@ -0,0 +1,69 @@ +<?php + +require_once "Base/TestAbstract.php"; + +class TestGetPlot_50 extends TestAbstract +{ + public function getAPI() { + return "getPlot"; + } + + public function getParams() { + return array( + "startTime" => "2008-01-01T00:00:00", + "stopTime" => "2008-01-02T00:00:00", + "missionID" => "ACE", + ); + } + + public function getDescription() { + return "Plot ACE data."; + } + + public function getWSTypes() { + return array("SOAP"); + } + + protected function checkRESTResult($result) { + return array( + 'success' => FALSE, + 'message' => 'Not implemented', + ); + } + + protected function checkSOAPResult($result) { + if (empty($result)) { + return array( + 'success' => FALSE, + 'message' => 'Empty result', + ); + } + + if (empty($result->success)) { + return array( + 'success' => FALSE, + 'message' => 'Error during plot request', + ); + } + + if ($result->status != 'done') { + return array( + 'success' => FALSE, + 'message' => 'Status is not done ('.$obj->status.')', + ); + } + + if (empty($result->plotFileURL)) { + return array( + 'success' => FALSE, + 'message' => 'Missing plot file URL in result', + ); + } + + return array( + 'success' => TRUE, + ); + } +} + +?> diff --git a/php/classes/AmdaStats.php b/php/classes/AmdaStats.php index e13e0b4..dcc0d83 100644 --- a/php/classes/AmdaStats.php +++ b/php/classes/AmdaStats.php @@ -13,7 +13,7 @@ class AmdaStats { public $success = true; private $user = null; private $task = array('request'=>'plot','condition'=>'mining', 'download'=>'print','statistics'=>'statistics', - 'getparameter'=>'ws_print', 'getdataset' => 'ws_print', 'getorbites' => 'ws_print'); + 'getparameter'=>'ws_print', 'getdataset' => 'ws_print', 'getorbites' => 'ws_print', 'getplot' => 'ws_plot'); public function __construct($user) { -- libgit2 0.21.2