From 0fafdb6d524cdb3f8be2554b843680276ec7d5b0 Mon Sep 17 00:00:00 2001 From: Tomas Paladin Volf Date: Mon, 28 Oct 2013 23:32:42 +0100 Subject: [PATCH 1/4] Updated AbstractValue to satisfy new test See ZF1 issue for more: https://github.com/zendframework/zf1/issues/229 --- src/AbstractValue.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/AbstractValue.php b/src/AbstractValue.php index e5e63a1..135ff82 100644 --- a/src/AbstractValue.php +++ b/src/AbstractValue.php @@ -445,6 +445,9 @@ protected static function _extractTypeAndValue(\SimpleXMLElement $xml, &$type, & // If no type was specified, the default is string if (!$type) { $type = self::XMLRPC_TYPE_STRING; + if (preg_match('#^.*$#', $xml->asXML())) { + $value = str_replace(array('', ''), '', $xml->asXML()); + } } } From c579f0bd301926843c2f07252fa0133e3d851a52 Mon Sep 17 00:00:00 2001 From: Tomas Paladin Volf Date: Mon, 28 Oct 2013 23:58:40 +0100 Subject: [PATCH 2/4] Fixed to use namespaces --- test/ValueTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ValueTest.php b/test/ValueTest.php index ae239a0..93ae64c 100644 --- a/test/ValueTest.php +++ b/test/ValueTest.php @@ -212,11 +212,11 @@ public function testMarshalStringFromNative() public function testFactoryAutodetectsStringAndSetsValueInArray() { - $val = Zend_XmlRpc_Value::getXmlRpcValue(''. + $val = AbstractValue::getXmlRpcValue(''. '8'. 'a'. 'false'. - '', Zend_XmlRpc_Value::XML_STRING + '', AbstractValue::XML_STRING ); $this->assertXmlRpcType('array', $val); $a = $val->getValue(); From 3f970b9040fa6a8bffe3ba7fc51649d25365ac66 Mon Sep 17 00:00:00 2001 From: Tomas Paladin Volf Date: Fri, 1 Nov 2013 16:26:08 +0100 Subject: [PATCH 3/4] Now passing tests. --- src/AbstractValue.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AbstractValue.php b/src/AbstractValue.php index 135ff82..3aa1008 100644 --- a/src/AbstractValue.php +++ b/src/AbstractValue.php @@ -445,7 +445,7 @@ protected static function _extractTypeAndValue(\SimpleXMLElement $xml, &$type, & // If no type was specified, the default is string if (!$type) { $type = self::XMLRPC_TYPE_STRING; - if (preg_match('#^.*$#', $xml->asXML())) { + if (empty($value) and preg_match('#^.*$#', $xml->asXML())) { $value = str_replace(array('', ''), '', $xml->asXML()); } } From c3804d1cb00403502aa7474a2b0292e94c04833e Mon Sep 17 00:00:00 2001 From: Tomas Paladin Volf Date: Fri, 1 Nov 2013 16:29:12 +0100 Subject: [PATCH 4/4] Removed trailing spaces in tests/ZendTest/XmlRpc/ValueTest.php --- test/ValueTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ValueTest.php b/test/ValueTest.php index 93ae64c..c036ccb 100644 --- a/test/ValueTest.php +++ b/test/ValueTest.php @@ -209,7 +209,7 @@ public function testMarshalStringFromNative() $this->assertXmlRpcType('string', $val); $this->assertSame($native, $val->getValue()); } - + public function testFactoryAutodetectsStringAndSetsValueInArray() { $val = AbstractValue::getXmlRpcValue(''.