1--TEST--
2SoapClient in non WSDL mode without required options
3--EXTENSIONS--
4soap
5--FILE--
6<?php
7
8class ExtendedSoapClient extends SoapClient {}
9
10echo "\$options not provided\n";
11try {
12    $client = new SoapClient(null);
13} catch (Throwable $e) {
14    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
15}
16try {
17    $client = new ExtendedSoapClient(null);
18} catch (Throwable $e) {
19    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
20}
21
22echo "Empty \$options array\n";
23$options = [];
24try {
25    $client = new SoapClient(null, $options);
26} catch (Throwable $e) {
27    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
28}
29try {
30    $client = new ExtendedSoapClient(null, $options);
31} catch (Throwable $e) {
32    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
33}
34
35echo "\$options array only sets \"uri\" option\n";
36$options = ['uri' => 'https://example.com'];
37try {
38    $client = new SoapClient(null, $options);
39} catch (Throwable $e) {
40    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
41}
42try {
43    $client = new ExtendedSoapClient(null, $options);
44} catch (Throwable $e) {
45    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
46}
47
48?>
49--EXPECT--
50$options not provided
51SoapFault: SoapClient::__construct(): 'location' and 'uri' options are required in nonWSDL mode
52SoapFault: SoapClient::__construct(): 'location' and 'uri' options are required in nonWSDL mode
53Empty $options array
54SoapFault: SoapClient::__construct(): 'uri' option is required in nonWSDL mode
55SoapFault: SoapClient::__construct(): 'uri' option is required in nonWSDL mode
56$options array only sets "uri" option
57SoapFault: SoapClient::__construct(): 'location' option is required in nonWSDL mode
58SoapFault: SoapClient::__construct(): 'location' option is required in nonWSDL mode
59