7 |
|
|
8 |
require_once('../vospace_service.php'); |
require_once('../vospace_service.php'); |
9 |
|
|
10 |
|
require_once('debug_funcs.php'); |
11 |
|
|
12 |
|
class target_node{ |
13 |
|
public $target; |
14 |
|
function __construct($tg) { |
15 |
|
$this->target = $tg; |
16 |
|
} |
17 |
|
} |
18 |
|
|
19 |
class TestVOSpaceService extends UnitTestCase { |
class TestVOSpaceService extends UnitTestCase { |
20 |
function TestVOSpaceService() { |
function setUp() { |
|
$this->UnitTestCase(); |
|
21 |
$this->vospace_server = new SoapServer('../vospace.wsdl', |
$this->vospace_server = new SoapServer('../vospace.wsdl', |
22 |
array('uri' => 'http://www.ivoa.net/xml/VOSpaceContract-v1.1rc1')); |
array('uri' => 'http://www.ivoa.net/xml/VOSpaceContract-v1.1rc1')); |
23 |
$this->vospace_server->SetClass("VOSpaceService"); |
$this->vospace_server->SetClass("VOSpaceService"); |
43 |
|
|
44 |
$prop_list = $this->service->GetProperties(); |
$prop_list = $this->service->GetProperties(); |
45 |
|
|
46 |
|
//barf_var($prop_list); |
47 |
|
|
48 |
$this->assertNotNull($prop_list); |
$this->assertNotNull($prop_list); |
49 |
|
|
50 |
$mime_type = $prop_list["provides"]["mime_type"]; |
$size = $prop_list["provides"][0]; |
51 |
|
|
52 |
// properties are of a class Property |
// properties are of a class Property |
53 |
$this->assertNotNull($mime_type); |
$this->assertNotNull($size); |
54 |
$this->assertEqual($mime_type->uri, "ivo://ivoa.net/vospace/core#mimetype"); |
$this->assertEqual($size["uri"], "ivo://net.ivoa.vospace/properties#size"); |
55 |
$this->assertEqual($mime_type->readOnly, TRUE); |
$this->assertEqual($size["readOnly"], TRUE); |
56 |
} |
} |
57 |
|
|
58 |
|
function testGetNode() { |
59 |
|
|
60 |
|
$node = $this->service->GetNode(new target_node('ivo://example.org!vospace/128cubed_hierarchy.png')); |
61 |
|
|
62 |
|
//barf_var($node); |
63 |
|
|
64 |
|
$this->assertNotNull($node["node"]); |
65 |
|
$this->assertEqual($node["node"]->properties[0]["_"], 569516); |
66 |
|
} |
67 |
|
|
68 |
|
|
69 |
} |
} |
70 |
|
|
71 |
|
|