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