TestGetParameter_33.php
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
require_once "Base/TestDownloadBase.php";
class TestGetParameter_33 extends TestDownloadBase
{
public function getAPI() {
return "getParameter";
}
protected function needRESTAuth() {
return TRUE;
}
public function getParams() {
return array(
"startTime" => "2008-01-01T00:00:00",
"stopTime" => "2008-01-01T01:00:00",
"parameterID" => "imf,mex_els_spec_sum",
"sampling" => 60,
);
}
public function getDescription() {
return "Get imf data. Sampling time 60s. Unix time. VOTable. Compressed";
}
protected function checkResultInfo($info) {
if ($info['structure'] != 'all-in-one-file') {
return array(
'success' => FALSE,
'message' => 'Bad file structure ('.$info['structure'].')',
);
}
if (!isset($info['sampling'])) {
return array(
'success' => FALSE,
'message' => 'Missing sampling time',
);
}
else if ($info['sampling'] != 60) {
return array(
'success' => FALSE,
'message' => 'Bad sampling time ('.$info['sampling'].')',
);
}
if (!in_array('imf', $info['parameters'])) {
return array(
'success' => FALSE,
'message' => 'Missing imf in result file',
);
}
if (!in_array('mex_els_spec_sum', $info['parameters'])) {
return array(
'success' => FALSE,
'message' => 'Missing mex_els_spec_sum in result file',
);
}
return array(
'success' => TRUE,
);
}
}
?>