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

Diff of /trunk/projects/grid/vospace/php_endpoint/tests/test_auth.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 737 by richard.p.wagner, Thu Aug 21 19:31:18 2008 UTC revision 738 by richard.p.wagner, Thu Aug 21 21:45:51 2008 UTC
# Line 91  Line 91 
91    }    }
92    
93    function testUnauthorized(){    function testUnauthorized(){
94           try {      try {
95             $this->secHeader = get_header('jon', 'don');        $this->secHeader = get_header('jon', 'don');
96          
97          $response_auth = $this->client->__soapCall('GetProtocols', array('GetProtocols'=>Null),
98                                                     null, $this->secHeader );
99          
100          $this->assertTrue(0, "Should have thrown not authenticated.");
101        }
102        catch (SoapFault $exp) {
103          $this->assertEqual($exp->faultstring, "Not authenticated.");
104        }    
105      }
106    
107      function testGetViewsCompare() {
108        $response_auth = $this->client->__soapCall('GetViews', array('GetViews'=>Null),
109                                                   null, $this->secHeader );
110        $response = $this->client->GetViews();
111        
112        $this->assertEqual($response_auth, $response);
113      }
114    
115             $response_auth = $this->client->__soapCall('GetProtocols', array('GetProtocols'=>Null),    function testUnauthorizedViews(){
116                                                        null, $this->secHeader );      try {
117          $this->secHeader = get_header('jon', 'don');
118          
119          $response_auth = $this->client->__soapCall('GetViews', array('GetViews'=>Null),
120                                                     null, $this->secHeader );
121          
122          $this->assertTrue(0, "Should have thrown not authenticated.");
123        }
124        catch (SoapFault $exp) {
125          $this->assertEqual($exp->faultstring, "Not authenticated.");
126        }    
127       }
128    
129             $this->assertTrue(0, "Should have thrown not authenticated.");    function testGetPropertiesUnAuth() {
130       }      try {
131       catch (SoapFault $exp) {        
132         $this->assertEqual($exp->faultstring, "Not authenticated.");        $response_auth = $this->client->__soapCall('GetProperties', array('GetProperties'=>Null),
133       }                                                   null, $this->secHeader );
134          
135          $this->assertTrue(0, "Should have thrown not authorized.");
136        }
137        catch (SoapFault $exp) {
138          $this->assertEqual($exp->faultstring, "Permission denied.");
139        }    
140    
141    }    }
142    
143  }  }
144    
145  $test = new TestVOSpaceAuthorization();  $test = new TestVOSpaceAuthorization();

Legend:
Removed from v.737  
changed lines
  Added in v.738

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