TestGetPlot_50.php 1.16 KB
<?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,
		);
	}
}

?>