|
|
@@ -248,9 +248,11 @@ class Zend_XmlRpc_ValueTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
|
/**
|
|
|
* @group ZF-7712
|
|
|
+ * @dataProvider Zend_XmlRpc_TestProvider::provideGenerators
|
|
|
*/
|
|
|
- public function testMarshallingDoubleWithHigherPrecisionFromNative()
|
|
|
+ public function testMarshallingDoubleWithHigherPrecisionFromNative(Zend_XmlRpc_Generator_Abstract $generator)
|
|
|
{
|
|
|
+ Zend_XmlRpc_Value::setGenerator($generator);
|
|
|
if (ini_get('precision') < 7) {
|
|
|
$this->markTestSkipped('precision is too low');
|
|
|
}
|
|
|
@@ -259,6 +261,24 @@ class Zend_XmlRpc_ValueTest extends PHPUnit_Framework_TestCase
|
|
|
$value = Zend_XmlRpc_Value::getXmlRpcValue($native, Zend_XmlRpc_Value::XMLRPC_TYPE_DOUBLE);
|
|
|
$this->assertXmlRpcType('double', $value);
|
|
|
$this->assertSame($native, $value->getValue());
|
|
|
+ $this->assertSame('<value><double>0.1234567</double></value>', trim($value->saveXml()));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @group ZF-7712
|
|
|
+ * @dataProvider Zend_XmlRpc_TestProvider::provideGenerators
|
|
|
+ */
|
|
|
+ public function testMarshallingDoubleWithHigherPrecisionFromNativeWithTrailingZeros(Zend_XmlRpc_Generator_Abstract $generator)
|
|
|
+ {
|
|
|
+ Zend_XmlRpc_Value::setGenerator($generator);
|
|
|
+ if (ini_get('precision') < 7) {
|
|
|
+ $this->markTestSkipped('precision is too low');
|
|
|
+ }
|
|
|
+ $native = 0.1;
|
|
|
+ $value = Zend_XmlRpc_Value::getXmlRpcValue($native, Zend_XmlRpc_Value::XMLRPC_TYPE_DOUBLE);
|
|
|
+ $this->assertXmlRpcType('double', $value);
|
|
|
+ $this->assertSame($native, $value->getValue());
|
|
|
+ $this->assertSame('<value><double>0.1</double></value>', trim($value->saveXml()));
|
|
|
}
|
|
|
|
|
|
// String
|