1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/soap: Add tests for invalid SOAP Headers argument

This commit is contained in:
Gina Peter Banyard
2024-06-16 14:31:41 +01:00
parent cd61f16ad8
commit 0fc5ec108e
2 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
--TEST--
SoapClient::__soapCall with invalid headers
--EXTENSIONS--
soap
--FILE--
<?php
/* Bypass constructor */
class ExtendedSoapClient extends SoapClient {
public function __construct() {}
}
$client = new ExtendedSoapClient();
$header = new SoapHeader('namespace', 'name');
$headers = [
$header,
'giberrish',
];
try {
$client->__setSoapHeaders($headers);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
Fatal error: SoapClient::__setSoapHeaders(): Invalid SOAP header in %s on line %d

View File

@@ -0,0 +1,28 @@
--TEST--
SoapClient::__soapCall with invalid headers
--EXTENSIONS--
soap
--FILE--
<?php
/* Bypass constructor */
class ExtendedSoapClient extends SoapClient {
public function __construct() {}
}
$client = new ExtendedSoapClient();
$header = new SoapHeader('namespace', 'name');
$headers = [
$header,
'giberrish',
];
try {
$client->__soapCall('function', ['arg'], ['options'], $headers);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
Fatal error: SoapClient::__soapCall(): Invalid SOAP header in %s on line %d