Exemplo n.º 1
0
 public function testErrorHandlingOfSoapServerChangesToThrowingSoapFaultWhenInHandleMode()
 {
     if (headers_sent()) {
         $this->markTestSkipped('Cannot run ' . __METHOD__ . '() when headers have already been sent; enable output buffering to run this test');
         return;
     }
     $server = new Server\Server();
     $server->setOptions(array('location' => 'test://', 'uri' => 'http://framework.zend.com'));
     $server->setReturnResponse(true);
     // Requesting Method with enforced parameter without it.
     $request = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ' . 'xmlns:ns1="http://framework.zend.com" ' . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' . 'xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" ' . 'SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' . '<SOAP-ENV:Body>' . '<ns1:testFunc5 />' . '</SOAP-ENV:Body>' . '</SOAP-ENV:Envelope>' . "\n";
     $server->setClass('Zend_Soap_Server_TestClass');
     $response = $server->handle($request);
     $this->assertContains('<SOAP-ENV:Fault><faultcode>Receiver</faultcode><faultstring>Test Message</faultstring></SOAP-ENV:Fault>', $response);
 }