xref: /PHP-8.3/ext/soap/tests/bugs/bug31422.phpt (revision 7f2f0c00)
1--TEST--
2Bug #31422 (No Error-Logging on SoapServer-Side)
3--EXTENSIONS--
4soap
5--INI--
6log_errors=1
7error_log=
8--FILE--
9<?php
10function Add($x,$y) {
11    fopen();
12    user_error("Hello", E_USER_ERROR);
13  return $x+$y;
14}
15
16$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
17$server->addfunction("Add");
18
19$HTTP_RAW_POST_DATA = <<<EOF
20<?xml version="1.0" encoding="ISO-8859-1"?>
21<SOAP-ENV:Envelope
22  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
23  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
24  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
25  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
26  xmlns:si="http://soapinterop.org/xsd">
27  <SOAP-ENV:Body>
28    <ns1:Add xmlns:ns1="http://testuri.org">
29      <x xsi:type="xsd:int">22</x>
30      <y xsi:type="xsd:int">33</y>
31    </ns1:Add>
32  </SOAP-ENV:Body>
33</SOAP-ENV:Envelope>
34EOF;
35
36$server->handle($HTTP_RAW_POST_DATA);
37echo "ok\n";
38?>
39--EXPECT--
40<?xml version="1.0" encoding="UTF-8"?>
41<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>fopen() expects at least 2 arguments, 0 given</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
42ok
43