Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
/**
4
 * Tests how the XML_RPC server handles a parameter with an empty struct without
5
 * any spaces in the XML after the empty value.
6
 *
7
 * PHP versions 4 and 5
8
 *
9
 * @category   Web Services
10
 * @package    XML_RPC
11
 * @author     Daniel Convissor <danielc@php.net>
12
 * @copyright  2005-2010 The PHP Group
13
 * @license    http://www.php.net/license/3_01.txt  PHP License
14
 * @version    SVN: $Id: empty-value-struct.php 300957 2010-07-02 23:55:00Z danielc $
15
 * @link       http://pear.php.net/package/XML_RPC
16
 * @since      File available since Release 1.4.4
17
 */
18
 
19
/*
20
 * If the package version number is found in the left hand
21
 * portion of the if() expression below, that means this file has
22
 * come from the PEAR installer.  Therefore, let's test the
23
 * installed version of XML_RPC which should be in the include path.
24
 *
25
 * If the version has not been substituted in the if() expression,
26
 * this file has likely come from a SVN checkout or a .tar file.
27
 * Therefore, we'll assume the tests should use the version of
28
 * XML_RPC that has come from there as well.
29
 */
30
if ('1.5.5' == '@'.'package_version'.'@') {
31
    ini_set('include_path', '../'
32
            . PATH_SEPARATOR . '.' . PATH_SEPARATOR
33
            . ini_get('include_path')
34
    );
35
}
36
require_once 'XML/RPC/Server.php';
37
 
38
 
39
$GLOBALS['HTTP_RAW_POST_DATA'] = <<<EOPOST
40
<?xml version="1.0"?>
41
<methodCall>
42
 <methodName>allgot</methodName>
43
  <params>
44
   <param>
45
    <value>
46
     <struct>
47
      <member>
48
      <name>fld1</name><value></value></member></struct></value>
49
   </param>
50
  </params>
51
 </methodCall>
52
EOPOST;
53
 
54
$expect = <<<EOEXP
55
<?xml version="1.0" encoding="UTF-8"?>
56
<methodResponse>
57
<params>
58
<param>
59
<value><string>param 0: array (
60
  'fld1' =&gt; '',
61
)
62
</string></value>
63
</param>
64
</params>
65
</methodResponse>
66
EOEXP;
67
 
68
include './allgot.inc';