diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2017-04-19 20:03:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-19 20:03:34 -0700 |
commit | 7be088202bad3a89498db2e9b19afda9f3929430 (patch) | |
tree | b3c027b951251e4e80d173acf0655a3c333ceb24 /php/tests/generated_class_test.php | |
parent | 190b5270c8717ca343db42da489e5e7d6d9efb2c (diff) | |
download | protobuf-7be088202bad3a89498db2e9b19afda9f3929430.tar.gz protobuf-7be088202bad3a89498db2e9b19afda9f3929430.tar.bz2 protobuf-7be088202bad3a89498db2e9b19afda9f3929430.zip |
Enum defined without package have incorrect class name. (#2988)
Fix the bug by sharing the code for generating class name for both
message and enum.
Diffstat (limited to 'php/tests/generated_class_test.php')
-rw-r--r-- | php/tests/generated_class_test.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/php/tests/generated_class_test.php b/php/tests/generated_class_test.php index 39e6c6c4..41d63a60 100644 --- a/php/tests/generated_class_test.php +++ b/php/tests/generated_class_test.php @@ -1,7 +1,7 @@ <?php -require_once('generated/NoNameSpaceEnum.php'); -require_once('generated/NoNameSpaceMessage.php'); +require_once('generated/NoNamespaceEnum.php'); +require_once('generated/NoNamespaceMessage.php'); require_once('test_base.php'); require_once('test_util.php'); @@ -832,12 +832,16 @@ class GeneratedClassTest extends TestBase public function testMessageWithoutNamespace() { - $m = new NoNameSpaceMessage(); + $m = new TestMessage(); + $m->setOptionalNoNamespaceMessage(new NoNameSpaceMessage()); + $m->getRepeatedNoNamespaceMessage()[] = new NoNameSpaceMessage(); } public function testEnumWithoutNamespace() { - $m = new NoNameSpaceEnum(); + $m = new TestMessage(); + $m->setOptionalNoNamespaceEnum(NoNameSpaceEnum::VALUE_A); + $m->getRepeatedNoNamespaceEnum()[] = NoNameSpaceEnum::VALUE_A; } ######################################################### |