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