xref: /PHP-7.2/ext/soap/tests/bugs/bug34643.phpt (revision 610c7fbe)
1--TEST--
2Bug #34643 (wsdl default value)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
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
19  function __construct($wsdl, $options) {
20    parent::__construct($wsdl, $options);
21    $this->server = new SoapServer($wsdl, $options);
22    $this->server->setClass('fp');
23  }
24
25  function __doRequest($request, $location, $action, $version, $one_way = 0) {
26    ob_start();
27    $this->server->handle($request);
28    $response = ob_get_contents();
29    ob_end_clean();
30    return $response;
31  }
32
33}
34
35$cl = new LocalSoapClient(dirname(__FILE__).'/bug34643.wsdl', array("trace"=>1));
36print_r($cl->__getFunctions());
37echo $cl->get_it("aaa")."\n";
38echo $cl->get_it()."\n";
39var_dump($cl->get_it(null));
40?>
41--EXPECT--
42Array
43(
44    [0] => string get_it(string $opt)
45)
46aaa
47zzz
48NULL
49