xref: /PHP-8.3/ext/soap/tests/bugs/gh16256.phpt (revision 922b9d67)
1--TEST--
2GH-16256 (Assertion failure in ext/soap/php_encoding.c:460)
3--EXTENSIONS--
4soap
5--FILE--
6<?php
7$classmap = [
8    "bogus",
9];
10$wsdl = __DIR__."/ext/soap/tests/bug41004.wsdl";
11try {
12    new SoapClient($wsdl, ["classmap" => $classmap]);
13} catch (Throwable $e) {
14    echo $e->getMessage(), "\n";
15}
16try {
17    new SoapServer($wsdl, ["classmap" => $classmap]);
18} catch (Throwable $e) {
19    echo $e->getMessage(), "\n";
20}
21?>
22--EXPECT--
23SoapClient::__construct(): 'classmap' option must be an associative array
24<?xml version="1.0" encoding="UTF-8"?>
25<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(): 'classmap' option must be an associative array</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
26