/[volute]/trunk/projects/grid/vospace/php_endpoint/tests/test_node.php
ViewVC logotype

Contents of /trunk/projects/grid/vospace/php_endpoint/tests/test_node.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 737 - (show annotations)
Thu Aug 21 19:31:18 2008 UTC (12 years, 2 months ago) by richard.p.wagner
File size: 1302 byte(s)
WS-Security header capturing
1 <?php
2
3 include('../config.inc');
4
5 require_once(SIMPLE_TEST . 'unit_tester.php');
6 require_once(SIMPLE_TEST . 'reporter.php');
7
8 require_once(BACKEND.'node.php');
9 require_once(BACKEND.'vospace.php');
10
11 class TestNode extends UnitTestCase {
12
13 function setUp() {
14 $this->node = new Node('ivo://example.org!vospace/bill_of_rights.txt');
15 }
16
17 function testNewNode() {
18 $this->assertNotNull($this->node);
19 $this->assertEqual($this->node->uri, 'ivo://example.org!vospace/bill_of_rights.txt');
20 $this->assertEqual($this->node->file_path, FILE_SYSTEM_ROOT . '/bill_of_rights.txt');
21 }
22
23 function testNodeExists() {
24 $this->assertTrue($this->node->exists());
25 }
26
27 function testNodeDoesntExist() {
28 $false_node = new Node('ivo://example.org!vospace/foo.txt');
29 $this->assertFalse($false_node->exists());
30 }
31
32 function testPropertySize(){
33 //bill_of_rights = 2821 bytes
34 $this->node->populateProperties();
35 $this->assertEqual( $this->node->properties[0]["_"], "2821");
36 $this->assertEqual( $this->node->properties[1]["_"], DATA_OWNER);
37 }
38
39 function testGetProtocols(){
40 $protocols = $this->node->getProtocols();
41 $this->assertEqual( $protocols['endpoint'],
42 HTTP_ROOT. '/bill_of_rights.txt');
43 }
44 }
45
46 $test = &new TestNode();
47 $test->run(new HtmlReporter());
48
49 ?>

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26