diff options
Diffstat (limited to 'php/tests')
-rw-r--r-- | php/tests/encode_decode_test.php | 7 | ||||
-rw-r--r-- | php/tests/generated_class_test.php | 1 | ||||
-rw-r--r-- | php/tests/memory_leak_test.php | 1 | ||||
-rw-r--r-- | php/tests/proto/test.proto | 4 |
4 files changed, 13 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() diff --git a/php/tests/generated_class_test.php b/php/tests/generated_class_test.php index 21ee8490..7289bbc5 100644 --- a/php/tests/generated_class_test.php +++ b/php/tests/generated_class_test.php @@ -876,5 +876,6 @@ class GeneratedClassTest extends TestBase $m = new \Foo\TestMessage_Empty(); $m = new \Foo\PBEmpty(); $m = new \PrefixEmpty(); + $m = new \Foo\PBARRAY(); } } diff --git a/php/tests/memory_leak_test.php b/php/tests/memory_leak_test.php index 361982b5..5eac56f0 100644 --- a/php/tests/memory_leak_test.php +++ b/php/tests/memory_leak_test.php @@ -8,6 +8,7 @@ require_once('generated/NoNamespaceMessage_NestedEnum.php'); require_once('generated/PrefixEmpty.php'); require_once('generated/PrefixTestPrefix.php'); require_once('generated/Bar/TestInclude.php'); +require_once('generated/Foo/PBARRAY.php'); require_once('generated/Foo/PBEmpty.php'); require_once('generated/Foo/TestEnum.php'); require_once('generated/Foo/TestIncludePrefixMessage.php'); diff --git a/php/tests/proto/test.proto b/php/tests/proto/test.proto index 39229254..583bf8e1 100644 --- a/php/tests/proto/test.proto +++ b/php/tests/proto/test.proto @@ -127,6 +127,10 @@ message Empty { int32 a = 1; } +message ARRAY { + int32 a = 1; +} + message TestPackedMessage { repeated int32 repeated_int32 = 90 [packed = true]; repeated int64 repeated_int64 = 91 [packed = true]; |