~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/soap/tests/server017.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
SOAP Server 17: user fault (through return)
 
3
--SKIPIF--
 
4
<?php require_once('skipif.inc'); ?>
 
5
--FILE--
 
6
<?php
 
7
function test() {
 
8
        return new SoapFault("MyFault","My fault string");
 
9
}
 
10
 
 
11
$server = new soapserver(null,array('uri'=>"http://testuri.org"));
 
12
$server->addfunction("test");
 
13
 
 
14
$HTTP_RAW_POST_DATA = <<<EOF
 
15
<?xml version="1.0" encoding="ISO-8859-1"?>
 
16
<SOAP-ENV:Envelope
 
17
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
 
18
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 
19
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 
20
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 
21
  xmlns:si="http://soapinterop.org/xsd">
 
22
  <SOAP-ENV:Body>
 
23
    <ns1:test xmlns:ns1="http://testuri.org"/>
 
24
  </SOAP-ENV:Body>
 
25
</SOAP-ENV:Envelope>
 
26
EOF;
 
27
 
 
28
$server->handle();
 
29
echo "ok\n";
 
30
?>
 
31
--EXPECT--
 
32
<?xml version="1.0" encoding="UTF-8"?>
 
33
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>MyFault</faultcode><faultstring>My fault string</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>