xref: /PHP-5.3/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
12--FILE--
13<?php
14function Add($x,$y) {
15	fopen();
16	user_error("Hello", E_USER_ERROR);
17  return $x+$y;
18}
19
20$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
21$server->addfunction("Add");
22
23$HTTP_RAW_POST_DATA = <<<EOF
24<?xml version="1.0" encoding="ISO-8859-1"?>
25<SOAP-ENV:Envelope
26  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
27  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
28  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
29  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
30  xmlns:si="http://soapinterop.org/xsd">
31  <SOAP-ENV:Body>
32    <ns1:Add xmlns:ns1="http://testuri.org">
33      <x xsi:type="xsd:int">22</x>
34      <y xsi:type="xsd:int">33</y>
35    </ns1:Add>
36  </SOAP-ENV:Body>
37</SOAP-ENV:Envelope>
38EOF;
39
40$server->handle($HTTP_RAW_POST_DATA);
41echo "ok\n";
42?>
43--EXPECTF--
44PHP Warning:  fopen() expects at least 2 parameters, 0 given in %sbug31422.php on line %d
45PHP Fatal error:  Hello in %sbug31422.php on line %d
46<?xml version="1.0" encoding="UTF-8"?>
47<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>
48