Skip to content

Commit db2c1e6

Browse files
committed
Add test with wrong output
1 parent 18233e0 commit db2c1e6

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

ext/soap/tests/bug69280.phpt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--TEST--
2+
Bug #69280 (SoapClient classmap doesn't support fully qualified class name)
3+
--EXTENSIONS--
4+
soap
5+
--INI--
6+
soap.wsdl_cache_enabled=0
7+
--CREDITS--
8+
champetier dot etienne at gmail dot com
9+
--FILE--
10+
<?php
11+
abstract class AbstractClass {
12+
public $prop;
13+
}
14+
15+
class RealClass1 extends AbstractClass {
16+
public $prop1;
17+
}
18+
19+
class TestWS extends \SoapClient {
20+
public function TestMethod($parameters) {
21+
return $this->__soapCall('TestMethod', [$parameters], [
22+
'uri' => 'http://tempuri.org/',
23+
'soapaction' => ''
24+
]
25+
);
26+
}
27+
28+
public function __doRequest(string $request, string $location, string $action, int $version, bool $oneWay = false): ?string {
29+
die($request);
30+
}
31+
}
32+
33+
$a = new TestWS(__DIR__ . '/bug69280.wsdl', ['classmap' => [
34+
'AbstractClass' => '\AbstractClass',
35+
'RealClass1' => '\RealClass1',
36+
]]);
37+
$r1 = new \RealClass1();
38+
$r1->prop = "prop";
39+
$r1->prop1 = "prop1";
40+
$a->TestMethod($r1);
41+
?>
42+
--EXPECT--
43+
<?xml version="1.0" encoding="UTF-8"?>
44+
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><parameters><prop>prop</prop><prop1>prop1</prop1></parameters></SOAP-ENV:Body></SOAP-ENV:Envelope>

ext/soap/tests/bug69280.wsdl

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:s0="http://tempuri.org/" name="TestWS" targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
3+
<types>
4+
<xs:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
5+
<xs:complexType name="AbstractClass">
6+
<xs:sequence>
7+
<xs:element minOccurs="0" maxOccurs="1" name="prop" type="xs:string" />
8+
</xs:sequence>
9+
</xs:complexType>
10+
<xs:complexType name="RealClass1">
11+
<xs:complexContent mixed="false">
12+
<xs:extension base="s0:AbstractClass">
13+
<xs:sequence>
14+
<xs:element minOccurs="0" maxOccurs="1" name="prop1" type="xs:string" />
15+
</xs:sequence>
16+
</xs:extension>
17+
</xs:complexContent>
18+
</xs:complexType>
19+
</xs:schema>
20+
</types>
21+
<message name="TestMethodSoapIn">
22+
<part name="parameters" element="RealClass1" />
23+
</message>
24+
<portType name="TestWSSoap">
25+
<operation name="TestMethod">
26+
<input message="s0:TestMethodSoapIn" />
27+
</operation>
28+
</portType>
29+
<binding name="TestWSSoap" type="s0:TestWSSoap">
30+
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
31+
<operation name="TestMethod">
32+
<soap:operation soapAction="http://tempuri.org/TestMethod" style="document" />
33+
<input>
34+
<soap:body use="literal" />
35+
</input>
36+
<output>
37+
<soap:body use="literal" />
38+
</output>
39+
</operation>
40+
</binding>
41+
<service name="TestWS">
42+
<port name="TestWSSoap" binding="s0:TestWSSoap">
43+
<soap:address location="http://tempuri.org/" />
44+
</port>
45+
</service>
46+
</definitions>

0 commit comments

Comments
 (0)