Accept string for int64 wrappers (#6491)
diff --git a/php/tests/encode_decode_test.php b/php/tests/encode_decode_test.php
index 5b373bb..f2a5018 100644
--- a/php/tests/encode_decode_test.php
+++ b/php/tests/encode_decode_test.php
@@ -118,12 +118,19 @@
$this->assertEquals(1, $m->getValue());
}
- # public function testEncodeTopLevelInt64Value()
- # {
- # $m = new Int64Value();
- # $m->setValue(1);
- # $this->assertSame("\"1\"", $m->serializeToJsonString());
- # }
+ public function testDecodeTopLevelInt64ValueAsString()
+ {
+ $m = new Int64Value();
+ $m->mergeFromJsonString("\"1\"");
+ $this->assertEquals(1, $m->getValue());
+ }
+
+ public function testEncodeTopLevelInt64Value()
+ {
+ $m = new Int64Value();
+ $m->setValue(1);
+ $this->assertSame("\"1\"", $m->serializeToJsonString());
+ }
public function testDecodeTopLevelUInt64Value()
{
@@ -132,12 +139,19 @@
$this->assertEquals(1, $m->getValue());
}
- # public function testEncodeTopLevelUInt64Value()
- # {
- # $m = new UInt64Value();
- # $m->setValue(1);
- # $this->assertSame("\"1\"", $m->serializeToJsonString());
- # }
+ public function testDecodeTopLevelUInt64ValueAsString()
+ {
+ $m = new UInt64Value();
+ $m->mergeFromJsonString("\"1\"");
+ $this->assertEquals(1, $m->getValue());
+ }
+
+ public function testEncodeTopLevelUInt64Value()
+ {
+ $m = new UInt64Value();
+ $m->setValue(1);
+ $this->assertSame("\"1\"", $m->serializeToJsonString());
+ }
public function testDecodeTopLevelStringValue()
{