@@ -18,6 +18,18 @@ function foo() {
1818}
1919$ s ->addFunction ("foo " );
2020
21+ function handleFormatted ($ s , $ input ) {
22+ ob_start ();
23+ $ s ->handle ($ input );
24+ $ response = ob_get_clean ();
25+
26+ // libxml2 2.13 has different formatting behaviour: it outputs <faultcode/> instead of <faultcode></faultcode>
27+ // this normalizes the output to <faultcode/>
28+ $ response = str_replace ('<faultcode></faultcode> ' , '<faultcode/> ' , $ response );
29+ $ response = str_replace ('<env:Value></env:Value> ' , '<env:Value/> ' , $ response );
30+ echo $ response ;
31+ }
32+
2133// soap 1.1
2234$ HTTP_RAW_POST_DATA = <<<EOF
2335<?xml version="1.0" encoding="UTF-8"?>
@@ -27,7 +39,7 @@ $HTTP_RAW_POST_DATA = <<<EOF
2739 </SOAP-ENV:Body>
2840</SOAP-ENV:Envelope>
2941EOF ;
30- $ s -> handle ( $ HTTP_RAW_POST_DATA );
42+ handleFormatted ( $ s , $ HTTP_RAW_POST_DATA );
3143
3244// soap 1.2
3345$ HTTP_RAW_POST_DATA = <<<EOF
@@ -38,10 +50,10 @@ $HTTP_RAW_POST_DATA = <<<EOF
3850 </env:Body>
3951</env:Envelope>
4052EOF ;
41- $ s -> handle ( $ HTTP_RAW_POST_DATA );
53+ handleFormatted ( $ s , $ HTTP_RAW_POST_DATA );
4254?>
4355--EXPECT--
4456<? xml version="1.0 " encoding="UTF -8 "?>
45- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode></faultcode ><faultstring>some msg</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
57+ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode/ ><faultstring>some msg</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
4658<? xml version="1.0 " encoding="UTF -8 "?>
47- <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value></env:Value ></env:Code><env:Reason><env:Text>some msg</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
59+ <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value/ ></env:Code><env:Reason><env:Text>some msg</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
0 commit comments