/** * @group ZF-5597 */ public function testServerAcceptsZendConfigObject() { $options = array('soap_version' => SOAP_1_1, 'actor' => 'http://framework.zend.com/Zend_Soap_ServerTest.php', 'classmap' => array('TestData1' => '\\ZendTest\\Soap\\TestAsset\\TestData1', 'TestData2' => '\\ZendTest\\Soap\\TestAsset\\TestData2'), 'encoding' => 'ISO-8859-1', 'uri' => 'http://framework.zend.com/Zend_Soap_ServerTest.php'); $config = new \Zend\Config\Config($options); $server = new Server(); $server->setOptions($config); $this->assertEquals($options, $server->getOptions()); }
/** * @runInSeparateProcess */ public function testShouldThrowExceptionIfHandledRequestContainsDoctype() { $server = new Server(); $server->setOptions(array('location' => 'test://', 'uri' => 'http://framework.zend.com')); $server->setReturnResponse(true); $server->setClass('\\ZendTest\\Soap\\TestAsset\\ServerTestClass'); $request = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<!DOCTYPE foo>' . "\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:testFunc2>' . '<param0 xsi:type="xsd:string">World</param0>' . '</ns1:testFunc2>' . '</SOAP-ENV:Body>' . '</SOAP-ENV:Envelope>' . "\n"; $response = $server->handle($request); $this->assertContains('Invalid XML', $response->getMessage()); }
public function testGetSoapInternalInstance() { $server = new Server(); $server->setOptions(array('location' => 'test://', 'uri' => 'http://framework.zend.com')); $internalServer = $server->getSoap(); $this->assertInstanceOf('\\SoapServer', $internalServer); $this->assertSame($internalServer, $server->getSoap()); }