Permalink
Browse files

Update test expectations and XML rendering

  • Loading branch information...
1 parent dc8394b commit 922a0949280f129eeefce9aaedc053301a0df1ee @CloCkWeRX CloCkWeRX committed Aug 30, 2012
Showing with 10 additions and 18 deletions.
  1. +7 −7 XML/RPC2/Backend/Php/Request.php
  2. +2 −2 XML/RPC2/Backend/Php/Response.php
  3. +1 −9 tests/XML_RPC2/regressions/18258.phpt
@@ -162,16 +162,16 @@ public function encode()
$parameters = $this->getParameters();
$result = '<?xml version="1.0" encoding="' . $this->_encoding . '"?>' . "\n";
- $result .= "<methodCall>\n";
- $result .= " <methodName>${methodName}</methodName>\n";
- $result .= " <params>\n";
+ $result .= "<methodCall>";
+ $result .= "<methodName>${methodName}</methodName>";
+ $result .= "<params>";
foreach($parameters as $parameter) {
- $result .= " <param>\n<value>";
+ $result .= "<param><value>";
$result .= ($parameter instanceof XML_RPC2_Backend_Php_Value) ? $parameter->encode() : XML_RPC2_Backend_Php_Value::createFromNative($parameter)->encode();
- $result .= "</value>\n </param>\n";
+ $result .= "</value></param>";
}
- $result .= " </params>\n";
- $result .= "</methodCall>\n";
+ $result .= "</params>";
+ $result .= "</methodCall>";
return $result;
}
@@ -82,7 +82,7 @@ public static function encode($param, $encoding = 'utf-8')
if (!$param instanceof XML_RPC2_Backend_Php_Value) {
$param = XML_RPC2_Backend_Php_Value::createFromNative($param);
}
- $result = '<?xml version="1.0" encoding="' . $encoding . '"?>';
+ $result = '<?xml version="1.0" encoding="' . $encoding . '"?>' . "\n";
$result .= '<methodResponse><params><param><value>' . $param->encode() . '</value></param></params></methodResponse>';
return $result;
}
@@ -102,7 +102,7 @@ public static function encode($param, $encoding = 'utf-8')
public static function encodeFault($code, $message, $encoding = 'utf-8')
{
$value = new XML_RPC2_Backend_Php_Value_Struct(array('faultCode' => (int) $code, 'faultString' => (string) $message));
- $result = '<?xml version="1.0" encoding="' . $encoding . '"?>';
+ $result = '<?xml version="1.0" encoding="' . $encoding . '"?>' . "\n";
$result .= '<methodResponse><fault><value>' . $value->encode() . '</value></fault></methodResponse>';
return $result;
}
@@ -37,12 +37,4 @@ $server->handleCall();
?>
--EXPECT--
<?xml version="1.0" encoding="utf-8"?>
-<methodResponse>
-<params>
- <param>
- <value>
- <int>12</int>
- </value>
- </param>
-</params>
-</methodResponse>
+<methodResponse><params><param><value><int>12</int></value></param></params></methodResponse>

0 comments on commit 922a094

Please sign in to comment.