summaryrefslogtreecommitdiff
path: root/ext/soap/tests/bugs
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:38:07 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:38:07 -0400
commitbb01389fbd53ec1cbcb80d0681a37cca1267891a (patch)
tree4783178fca65a5d9071c8df34f2ddc3d31728673 /ext/soap/tests/bugs
parenteddbbea4325e602ddc87c545531609132d4f0e3b (diff)
downloadphp-bb01389fbd53ec1cbcb80d0681a37cca1267891a.tar.gz
Imported Upstream version 5.2.4upstream/5.2.4
Diffstat (limited to 'ext/soap/tests/bugs')
-rwxr-xr-xext/soap/tests/bugs/bug41566.phpt65
-rwxr-xr-xext/soap/tests/bugs/bug42151.phpt31
-rwxr-xr-xext/soap/tests/bugs/bug42183.phpt27
3 files changed, 123 insertions, 0 deletions
diff --git a/ext/soap/tests/bugs/bug41566.phpt b/ext/soap/tests/bugs/bug41566.phpt
new file mode 100755
index 000000000..a18b596e0
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41566.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Bug #41566 (SOAP Server not properly generating href attributes)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test() {
+ $aUser = new User();
+ $aUser->sName = 'newUser';
+
+ $aUsers = Array();
+ $aUsers[] = $aUser;
+ $aUsers[] = $aUser;
+ $aUsers[] = $aUser;
+ $aUsers[] = $aUser;
+ return $aUsers;
+}
+
+/* Simple User definition */
+Class User {
+ /** @var string */
+ public $sName;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org", 'soap_version'=>SOAP_1_2));
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+ob_start();
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:ns1="http://testuri.org"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <env:Body>
+ <ns1:test env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </env:Body>
+</env:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+ob_flush();
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return SOAP-ENC:arrayType="SOAP-ENC:Struct[4]" xsi:type="SOAP-ENC:Array"><item xsi:type="SOAP-ENC:Struct" id="ref1"><sName xsi:type="xsd:string">newUser</sName></item><item href="#ref1"/><item href="#ref1"/><item href="#ref1"/></return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://testuri.org" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:testResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="enc:Struct" enc:arraySize="4" xsi:type="enc:Array"><item xsi:type="enc:Struct" enc:id="ref1"><sName xsi:type="xsd:string">newUser</sName></item><item enc:ref="#ref1"/><item enc:ref="#ref1"/><item enc:ref="#ref1"/></return></ns1:testResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug42151.phpt b/ext/soap/tests/bugs/bug42151.phpt
new file mode 100755
index 000000000..7f7a87bd1
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42151.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Bug #42151 __destruct functions not called after catching a SoapFault exception
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class foo {
+ function __construct(){
+ $foo = @ new SoapClient('httpx://');
+ }
+ function __destruct(){
+ echo 'I never get executed.' . "\n";
+ }
+}
+class bar {
+ function __destruct(){
+ echo 'I don\'t get executed either.' . "\n";
+ }
+}
+try {
+ $bar = new bar();
+ $foo = new foo();
+} catch (Exception $e){
+ echo $e->getMessage() . "\n";
+}
+echo "ok\n";
+?>
+--EXPECT--
+SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://'
+ok
+I don't get executed either.
diff --git a/ext/soap/tests/bugs/bug42183.phpt b/ext/soap/tests/bugs/bug42183.phpt
new file mode 100755
index 000000000..d34311f26
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42183.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #42183 (classmap cause crash in non-wsdl mode )
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class PHPObject {
+}
+
+$req = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws.sit.com" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+
+function test() {
+ return new PHPObject();
+}
+
+$server = new SoapServer(NULL, array('uri' => 'http://ws.sit.com',
+ 'classmap' => array('Object' => 'PHPObject')));
+$server->addFunction("test");
+ob_start();
+$server->handle($req);
+ob_end_clean();
+echo "ok\n";
+--EXPECT--
+ok