xref: /PHP-7.3/ext/soap/tests/bugs/bug38004.phpt (revision 610c7fbe)
1--TEST--
2Bug #38004 (Parameters in SoapServer are decoded twice)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--INI--
6soap.wsdl_cache_enabled=0
7--FILE--
8<?php
9function Test($param) {
10	global $g;
11	$g = $param->strA."\n".$param->strB."\n";
12	return $g;
13}
14
15class TestSoapClient extends SoapClient {
16  function __construct($wsdl) {
17    parent::__construct($wsdl);
18    $this->server = new SoapServer($wsdl);
19    $this->server->addFunction('Test');
20  }
21
22  function __doRequest($request, $location, $action, $version, $one_way = 0) {
23    ob_start();
24    $this->server->handle($request);
25    $response = ob_get_contents();
26    ob_end_clean();
27    return $response;
28  }
29}
30
31$client = new TestSoapClient(dirname(__FILE__).'/bug38004.wsdl');
32$strA = 'test &amp; test';
33$strB = 'test & test';
34$res = $client->Test(array('strA'=>$strA, 'strB'=>$strB));
35print_r($res);
36print_r($g);
37?>
38--EXPECT--
39test &amp; test
40test & test
41test &amp; test
42test & test
43