Browse Source

ZF-11411
Fixed Zend_Soap_Server to use the xml from DomDocument when passed to handle()


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24065 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph 14 years ago
parent
commit
d9313d6631
2 changed files with 27 additions and 1 deletions
  1. 1 1
      library/Zend/Soap/Server.php
  2. 26 0
      tests/Zend/Soap/ServerTest.php

+ 1 - 1
library/Zend/Soap/Server.php

@@ -829,7 +829,7 @@ class Zend_Soap_Server implements Zend_Server_Interface
             $soap->fault("Sender", $setRequestException->getMessage());
         } else {
             try {
-                $soap->handle($request);
+                $soap->handle($this->_request);
             } catch (Exception $e) {
                 $fault = $this->fault($e);
                 $soap->fault($fault->faultcode, $fault->faultstring);

+ 26 - 0
tests/Zend/Soap/ServerTest.php

@@ -890,6 +890,16 @@ class Zend_Soap_ServerTest extends PHPUnit_Framework_TestCase
         $this->assertTrue(isset($options['cache_wsdl']));
         $this->assertEquals(100, $options['cache_wsdl']);
     }
+    
+    /**
+     * @group ZF-11411
+     */
+    public function testHandleUsesProperRequestParameter()
+    {
+        $server = new Zend_Soap_MockServer();
+        $r = $server->handle(new DomDocument('1.0', 'UTF-8'));
+        $this->assertTrue(is_string($server->mockSoapServer->handle[0]));
+    }
 }
 
 
@@ -930,6 +940,22 @@ class Zend_Soap_Server_TestLocalSoapClient extends SoapClient
 
 }
 
+class MockSoapServer {
+    public $handle = null;
+    public function handle()
+    {
+        $this->handle = func_get_args();
+    }
+    public function __call($name, $args) {}
+}
+
+class Zend_Soap_MockServer extends Zend_Soap_Server {
+    public $mockSoapServer = null;
+    protected function _getSoap() {
+        $this->mockSoapServer = new MockSoapServer(); 
+        return $this->mockSoapServer;
+    }
+}
 
 /** Test Class */
 class Zend_Soap_Server_TestClass {