53 lines
1.5 KiB
PHP
53 lines
1.5 KiB
PHP
--TEST--
|
|
SoapServer in non WSDL mode without required options
|
|
--EXTENSIONS--
|
|
soap
|
|
--FILE--
|
|
<?php
|
|
|
|
class ExtendedSoapServer extends SoapServer {}
|
|
|
|
echo "\$options not provided\n";
|
|
try {
|
|
$client = new SoapServer(null);
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
try {
|
|
$client = new ExtendedSoapServer(null);
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
|
|
echo "Empty \$options array\n";
|
|
$options = [];
|
|
try {
|
|
$client = new SoapServer(null, $options);
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
try {
|
|
$client = new ExtendedSoapServer(null, $options);
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
|
|
echo "\$options array only sets \"uri\" option\n";
|
|
$options = ['uri' => 'https://example.com'];
|
|
try {
|
|
$client = new SoapServer(null, $options);
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
try {
|
|
$client = new ExtendedSoapServer(null, $options);
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
$options not provided
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>SoapServer::__construct(): 'uri' option is required in nonWSDL mode</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
|