aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/tests/encode_decode_test.php
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2017-06-20 22:53:22 -0700
committerGravatar GitHub <noreply@github.com>2017-06-20 22:53:22 -0700
commit8ecae34ac65218e9fda1586abc39f8762dbb40de (patch)
treef5ebd70dd889b94872f0e4fe75704d21998dd4cd /php/tests/encode_decode_test.php
parentbf04c83267619b618e7112b242f424f8b3e785b6 (diff)
parent3b1a87518cead7403b8e13c41945e41a30d602e4 (diff)
Merge pull request #3255 from TeBoring/3.3.x-3
Cherry-pick bug fixes for php
Diffstat (limited to 'php/tests/encode_decode_test.php')
-rw-r--r--php/tests/encode_decode_test.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/php/tests/encode_decode_test.php b/php/tests/encode_decode_test.php
index 288df569..b4cfed42 100644
--- a/php/tests/encode_decode_test.php
+++ b/php/tests/encode_decode_test.php
@@ -88,6 +88,13 @@ class EncodeDecodeTest extends TestBase
$n = new TestMessage();
$n->mergeFromString($data);
$this->assertSame(1, $n->getOneofMessage()->getA());
+
+ // Encode default value
+ $m->setOneofEnum(TestEnum::ZERO);
+ $data = $m->serializeToString();
+ $n = new TestMessage();
+ $n->mergeFromString($data);
+ $this->assertSame("oneof_enum", $n->getMyOneof());
}
public function testPackedEncode()