Skip to content

Commit 1fdd79c

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix SOAP test failure on libxml2 2.13
2 parents a5bd4cc + 979e68a commit 1fdd79c

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

ext/soap/tests/bug68996.phpt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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>
2941
EOF;
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>
4052
EOF;
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

Comments
 (0)