Fix oneof message in array constructor (#5727)
diff --git a/php/tests/generated_class_test.php b/php/tests/generated_class_test.php
index 93b7b29..a9ad793 100644
--- a/php/tests/generated_class_test.php
+++ b/php/tests/generated_class_test.php
@@ -1447,6 +1447,20 @@
}
}
+ public function testOneofMessageInArrayConstructor()
+ {
+ $m = new TestMessage([
+ 'oneof_message' => new Sub(),
+ ]);
+ }
+
+ public function testOneofStringInArrayConstructor()
+ {
+ $m = new TestMessage([
+ 'oneof_string' => 'abc',
+ ]);
+ }
+
#########################################################
# Test message equals.
#########################################################