diff options
Diffstat (limited to 'php/tests/proto')
-rw-r--r-- | php/tests/proto/empty/echo.proto | 17 | ||||
-rw-r--r-- | php/tests/proto/test_empty_php_namespace.proto | 10 | ||||
-rw-r--r-- | php/tests/proto/test_include.proto | 11 | ||||
-rw-r--r-- | php/tests/proto/test_no_namespace.proto | 12 | ||||
-rw-r--r-- | php/tests/proto/test_php_namespace.proto | 22 | ||||
-rw-r--r-- | php/tests/proto/test_prefix.proto | 8 |
6 files changed, 76 insertions, 4 deletions
diff --git a/php/tests/proto/empty/echo.proto b/php/tests/proto/empty/echo.proto new file mode 100644 index 00000000..1817018d --- /dev/null +++ b/php/tests/proto/empty/echo.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package empty.echo; + +message TestEmptyPackage { + int32 a = 1; + + // Test nested messages, enums, and reserved names + NestedMessage nested_message = 2; + NestedEnum nested_enum = 3; + message NestedMessage { + int32 a = 1; + } + enum NestedEnum { + ZERO = 0; + }; +} diff --git a/php/tests/proto/test_empty_php_namespace.proto b/php/tests/proto/test_empty_php_namespace.proto index 1d02f760..c7ed1657 100644 --- a/php/tests/proto/test_empty_php_namespace.proto +++ b/php/tests/proto/test_empty_php_namespace.proto @@ -6,4 +6,14 @@ option php_metadata_namespace = ""; message TestEmptyNamespace { int32 a = 1; + + // Test nested messages, enums, and reserved names + NestedMessage nested_message = 2; + NestedEnum nested_enum = 3; + message NestedMessage { + int32 a = 1; + } + enum NestedEnum { + ZERO = 0; + }; } diff --git a/php/tests/proto/test_include.proto b/php/tests/proto/test_include.proto index 9844617f..a9072fe3 100644 --- a/php/tests/proto/test_include.proto +++ b/php/tests/proto/test_include.proto @@ -5,3 +5,14 @@ package bar; message TestInclude { int32 a = 1; } + +message TestLegacyMessage { + NestedMessage message = 1; + NestedEnum enum = 2; + message NestedMessage { + int32 a = 1; + } + enum NestedEnum { + ZERO = 0; + } +} diff --git a/php/tests/proto/test_no_namespace.proto b/php/tests/proto/test_no_namespace.proto index 03f89270..cce42ea2 100644 --- a/php/tests/proto/test_no_namespace.proto +++ b/php/tests/proto/test_no_namespace.proto @@ -5,11 +5,15 @@ option php_metadata_namespace = "\\"; message NoNamespaceMessage { int32 a = 1; - enum NestedEnum { - ZERO = 0; + // Test nested messages, enums, and reserved names + NestedMessage nested_message = 2; + NestedEnum nested_enum = 3; + message NestedMessage { + int32 a = 1; } - NestedEnum b = 2; - repeated NestedEnum c = 3; + enum NestedEnum { + ZERO = 0; + }; } enum NoNamespaceEnum { diff --git a/php/tests/proto/test_php_namespace.proto b/php/tests/proto/test_php_namespace.proto index bb57d617..61085bf7 100644 --- a/php/tests/proto/test_php_namespace.proto +++ b/php/tests/proto/test_php_namespace.proto @@ -6,4 +6,26 @@ option php_metadata_namespace = "Metadata\\Php\\Test"; message TestNamespace { int32 a = 1; + + // Test nested messages, enums, and reserved names + NestedMessage nested_message = 2; + NestedEnum nested_enum = 3; + Empty reserved_name = 4; + message NestedMessage { + int32 a = 1; + } + enum NestedEnum { + ZERO = 0; + }; + // Test reserved name + message Empty { + NestedMessage nested_message = 1; + NestedEnum nested_enum = 2; + message NestedMessage { + int32 a = 1; + } + enum NestedEnum { + ZERO = 0; + }; + } } diff --git a/php/tests/proto/test_prefix.proto b/php/tests/proto/test_prefix.proto index 9bfbad7f..3fa11381 100644 --- a/php/tests/proto/test_prefix.proto +++ b/php/tests/proto/test_prefix.proto @@ -4,6 +4,14 @@ option php_class_prefix = "Prefix"; message TestPrefix { int32 a = 1; + NestedMessage nested_message = 2; + NestedEnum nested_enum = 3; + message NestedMessage { + int32 a = 1; + } + enum NestedEnum { + ZERO = 0; + }; } // Test prefix for reserved words. |