From 56e42f6940a704a18d1e6c1501bc22be1c1e52d8 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 8 Sep 2024 12:33:11 +0200 Subject: [PATCH] Fix SOAP test failure on libxml2 2.13 libxml2 2.13 has different formatting behaviour: it outputs `` instead of ``, and similarly for `env:Value`. Normalize the output. --- ext/soap/tests/bug68996.phpt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ext/soap/tests/bug68996.phpt b/ext/soap/tests/bug68996.phpt index edae5c953d3f..618f5ec730e7 100644 --- a/ext/soap/tests/bug68996.phpt +++ b/ext/soap/tests/bug68996.phpt @@ -18,6 +18,18 @@ function foo() { } $s->addFunction("foo"); +function handleFormatted($s, $input) { + ob_start(); + $s->handle($input); + $response = ob_get_clean(); + + // libxml2 2.13 has different formatting behaviour: it outputs instead of + // this normalizes the output to + $response = str_replace('', '', $response); + $response = str_replace('', '', $response); + echo $response; +} + // soap 1.1 $HTTP_RAW_POST_DATA = << @@ -27,7 +39,7 @@ $HTTP_RAW_POST_DATA = << EOF; -$s->handle($HTTP_RAW_POST_DATA); +handleFormatted($s, $HTTP_RAW_POST_DATA); // soap 1.2 $HTTP_RAW_POST_DATA = << EOF; -$s->handle($HTTP_RAW_POST_DATA); +handleFormatted($s, $HTTP_RAW_POST_DATA); ?> --EXPECT-- -some msg +some msg -some msg +some msg