xref: /php-src/ext/soap/tests/bugs/bug34643.phpt (revision 8b561d33)
1--TEST--
2Bug #34643 (wsdl default value)
3--EXTENSIONS--
4soap
5--INI--
6soap.wsdl_cache_enabled=0
7--FILE--
8<?php
9ini_set("soap.wsdl_cache_enabled", 0);
10
11class fp {
12    public function get_it($opt="zzz") {
13        return $opt;
14    }
15}
16
17class LocalSoapClient extends SoapClient {
18  private $server;
19
20  function __construct($wsdl, $options) {
21    parent::__construct($wsdl, $options);
22    $this->server = new SoapServer($wsdl, $options);
23    $this->server->setClass('fp');
24  }
25
26  function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
27    ob_start();
28    $this->server->handle($request);
29    $response = ob_get_contents();
30    ob_end_clean();
31    return $response;
32  }
33
34}
35
36$cl = new LocalSoapClient(__DIR__.'/bug34643.wsdl', array("trace"=>1));
37print_r($cl->__getFunctions());
38echo $cl->get_it("aaa")."\n";
39echo $cl->get_it()."\n";
40var_dump($cl->get_it(null));
41?>
42--EXPECT--
43Array
44(
45    [0] => string get_it(string $opt)
46)
47aaa
48zzz
49NULL
50