diff options
author | Bo Yang <teboring@google.com> | 2017-01-10 01:02:35 +0000 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2017-01-10 01:02:35 +0000 |
commit | e259b515a5baae2d7d7623af62ea87079a5e91a0 (patch) | |
tree | 218bd84998ce230182a06f191b4dce4eb47983a9 /php | |
parent | 83fb8c7d29a221851817fd889a716654f6bfb96c (diff) | |
download | protobuf-e259b515a5baae2d7d7623af62ea87079a5e91a0.tar.gz protobuf-e259b515a5baae2d7d7623af62ea87079a5e91a0.tar.bz2 protobuf-e259b515a5baae2d7d7623af62ea87079a5e91a0.zip |
Fix generated code when there is no namespace but there is enum definition.
Diffstat (limited to 'php')
-rw-r--r-- | php/tests/generated_class_test.php | 11 | ||||
-rw-r--r-- | php/tests/proto/test_no_namespace.proto | 7 |
2 files changed, 14 insertions, 4 deletions
diff --git a/php/tests/generated_class_test.php b/php/tests/generated_class_test.php index 27912ecd..6381419d 100644 --- a/php/tests/generated_class_test.php +++ b/php/tests/generated_class_test.php @@ -1,6 +1,7 @@ <?php -require_once('generated/NoNameSpace.php'); +require_once('generated/NoNameSpaceEnum.php'); +require_once('generated/NoNameSpaceMessage.php'); require_once('test_util.php'); use Google\Protobuf\Internal\RepeatedField; @@ -601,10 +602,14 @@ class GeneratedClassTest extends PHPUnit_Framework_TestCase } ######################################################### - # Test oneof field. + # Test message/enum without namespace. ######################################################### public function testMessageWithoutNamespace() { - $m = new NoNameSpace(); + $m = new NoNameSpaceMessage(); + } + + public function testEnumWithoutNamespace() { + $m = new NoNameSpaceEnum(); } } diff --git a/php/tests/proto/test_no_namespace.proto b/php/tests/proto/test_no_namespace.proto index 4331aeab..b8c4fdf2 100644 --- a/php/tests/proto/test_no_namespace.proto +++ b/php/tests/proto/test_no_namespace.proto @@ -1,5 +1,10 @@ syntax = "proto3"; -message NoNameSpace { +message NoNameSpaceMessage { int32 a = 1; } + +enum NoNameSpaceEnum { + VALUE_A = 0; + VALUE_B = 1; +} |