diff options
author | Valery Piashchynski <[email protected]> | 2021-09-16 21:24:13 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-16 21:24:13 +0300 |
commit | 337d292dd2d6ff0a555098b1970d8194d8df8bc2 (patch) | |
tree | a2ab31666f95813a592bea2b207f2db0ba188c92 /tests/plugins/grpc/testdata | |
parent | 5d2cd55ab522d4f1e65a833f91146444465a32ac (diff) | |
parent | cc56349f3ad19aa54ae7900c50e018d757305804 (diff) |
[#783]: feat(grpc): update GRPC plugin to RR `v2`
[#783]: feat(grpc): update GRPC plugin to RR `v2`
Diffstat (limited to 'tests/plugins/grpc/testdata')
12 files changed, 226 insertions, 0 deletions
diff --git a/tests/plugins/grpc/testdata/import/Import/ServiceInterface.php b/tests/plugins/grpc/testdata/import/Import/ServiceInterface.php new file mode 100644 index 00000000..13e58daf --- /dev/null +++ b/tests/plugins/grpc/testdata/import/Import/ServiceInterface.php @@ -0,0 +1,32 @@ +<?php +# Generated by the protocol buffer compiler (spiral/php-grpc). DO NOT EDIT! +# source: import/service.proto + +namespace Import; + +use Spiral\GRPC; +use Import\Sub; + +interface ServiceInterface extends GRPC\ServiceInterface +{ + // GRPC specific service name. + public const NAME = "import.Service"; + + /** + * @param GRPC\ContextInterface $ctx + * @param Message $in + * @return Message + * + * @throws GRPC\Exception\InvokeException + */ + public function SimpleMethod(GRPC\ContextInterface $ctx, Message $in): Message; + + /** + * @param GRPC\ContextInterface $ctx + * @param Sub\Message $in + * @return Sub\Message + * + * @throws GRPC\Exception\InvokeException + */ + public function ImportMethod(GRPC\ContextInterface $ctx, Sub\Message $in): Sub\Message; +} diff --git a/tests/plugins/grpc/testdata/import/service.proto b/tests/plugins/grpc/testdata/import/service.proto new file mode 100644 index 00000000..5d888f09 --- /dev/null +++ b/tests/plugins/grpc/testdata/import/service.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package import; + +import "import/sub/message.proto"; + +service Service { + rpc SimpleMethod (Message) returns (Message) { + } + + rpc ImportMethod (import.sub.Message) returns (import.sub.Message) { + } +} + +message Message { + int64 id = 1; +}
\ No newline at end of file diff --git a/tests/plugins/grpc/testdata/import/sub/message.proto b/tests/plugins/grpc/testdata/import/sub/message.proto new file mode 100644 index 00000000..1db0313b --- /dev/null +++ b/tests/plugins/grpc/testdata/import/sub/message.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +package import.sub; + +message Message { + int64 id = 1; +}
\ No newline at end of file diff --git a/tests/plugins/grpc/testdata/import_custom/Test/CustomImport/ServiceInterface.php b/tests/plugins/grpc/testdata/import_custom/Test/CustomImport/ServiceInterface.php new file mode 100644 index 00000000..b010ce4f --- /dev/null +++ b/tests/plugins/grpc/testdata/import_custom/Test/CustomImport/ServiceInterface.php @@ -0,0 +1,32 @@ +<?php +# Generated by the protocol buffer compiler (spiral/php-grpc). DO NOT EDIT! +# source: import_custom/service.proto + +namespace Test\CustomImport; + +use Spiral\GRPC; +use Test\CustomImport\Message; + +interface ServiceInterface extends GRPC\ServiceInterface +{ + // GRPC specific service name. + public const NAME = "import.Service"; + + /** + * @param GRPC\ContextInterface $ctx + * @param Message $in + * @return Message + * + * @throws GRPC\Exception\InvokeException + */ + public function SimpleMethod(GRPC\ContextInterface $ctx, Message $in): Message; + + /** + * @param GRPC\ContextInterface $ctx + * @param Message\Message $in + * @return Message\Message + * + * @throws GRPC\Exception\InvokeException + */ + public function ImportMethod(GRPC\ContextInterface $ctx, Message\Message $in): Message\Message; +} diff --git a/tests/plugins/grpc/testdata/import_custom/service.proto b/tests/plugins/grpc/testdata/import_custom/service.proto new file mode 100644 index 00000000..872aaae3 --- /dev/null +++ b/tests/plugins/grpc/testdata/import_custom/service.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package import; + +option php_namespace = "Test\\CustomImport"; + +import "import_custom/sub/message.proto"; + +service Service { + rpc SimpleMethod (Message) returns (Message) { + } + + rpc ImportMethod (import.sub.Message) returns (import.sub.Message) { + } +} + +message Message { + int64 id = 1; +}
\ No newline at end of file diff --git a/tests/plugins/grpc/testdata/import_custom/sub/message.proto b/tests/plugins/grpc/testdata/import_custom/sub/message.proto new file mode 100644 index 00000000..5d722ca3 --- /dev/null +++ b/tests/plugins/grpc/testdata/import_custom/sub/message.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package import.sub; +option php_namespace = "Test\\CustomImport\\Message"; + + +service Service { + rpc AnotherMethod (Message) returns (Message) { + } +} + +message Message { + int64 id = 1; +}
\ No newline at end of file diff --git a/tests/plugins/grpc/testdata/php_namespace/Test/CustomNamespace/ServiceInterface.php b/tests/plugins/grpc/testdata/php_namespace/Test/CustomNamespace/ServiceInterface.php new file mode 100644 index 00000000..2090ba97 --- /dev/null +++ b/tests/plugins/grpc/testdata/php_namespace/Test/CustomNamespace/ServiceInterface.php @@ -0,0 +1,22 @@ +<?php +# Generated by the protocol buffer compiler (spiral/php-grpc). DO NOT EDIT! +# source: php_namespace/service.proto + +namespace Test\CustomNamespace; + +use Spiral\GRPC; + +interface ServiceInterface extends GRPC\ServiceInterface +{ + // GRPC specific service name. + public const NAME = "testPhpNamespace.Service"; + + /** + * @param GRPC\ContextInterface $ctx + * @param SimpleMessage $in + * @return SimpleMessage + * + * @throws GRPC\Exception\InvokeException + */ + public function SimpleMethod(GRPC\ContextInterface $ctx, SimpleMessage $in): SimpleMessage; +} diff --git a/tests/plugins/grpc/testdata/php_namespace/service.proto b/tests/plugins/grpc/testdata/php_namespace/service.proto new file mode 100644 index 00000000..a3bfa3c0 --- /dev/null +++ b/tests/plugins/grpc/testdata/php_namespace/service.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package testPhpNamespace; + +option php_namespace = "Test\\CustomNamespace"; + +service Service { + rpc SimpleMethod (SimpleMessage) returns (SimpleMessage) { + } +} + +message SimpleMessage { + int32 id = 1; + string name = 2; +}
\ No newline at end of file diff --git a/tests/plugins/grpc/testdata/simple/TestSimple/SimpleServiceInterface.php b/tests/plugins/grpc/testdata/simple/TestSimple/SimpleServiceInterface.php new file mode 100644 index 00000000..f9e84bf7 --- /dev/null +++ b/tests/plugins/grpc/testdata/simple/TestSimple/SimpleServiceInterface.php @@ -0,0 +1,22 @@ +<?php +# Generated by the protocol buffer compiler (spiral/php-grpc). DO NOT EDIT! +# source: simple/simple.proto + +namespace TestSimple; + +use Spiral\GRPC; + +interface SimpleServiceInterface extends GRPC\ServiceInterface +{ + // GRPC specific service name. + public const NAME = "testSimple.SimpleService"; + + /** + * @param GRPC\ContextInterface $ctx + * @param SimpleMessage $in + * @return SimpleMessage + * + * @throws GRPC\Exception\InvokeException + */ + public function SimpleMethod(GRPC\ContextInterface $ctx, SimpleMessage $in): SimpleMessage; +} diff --git a/tests/plugins/grpc/testdata/simple/simple.proto b/tests/plugins/grpc/testdata/simple/simple.proto new file mode 100644 index 00000000..aca3c1d9 --- /dev/null +++ b/tests/plugins/grpc/testdata/simple/simple.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package testSimple; + +service SimpleService { + rpc SimpleMethod (SimpleMessage) returns (SimpleMessage) { + } +} + +message SimpleMessage { + int32 id = 1; + string name = 2; +}
\ No newline at end of file diff --git a/tests/plugins/grpc/testdata/use_empty/Test/ServiceInterface.php b/tests/plugins/grpc/testdata/use_empty/Test/ServiceInterface.php new file mode 100644 index 00000000..fe6d345a --- /dev/null +++ b/tests/plugins/grpc/testdata/use_empty/Test/ServiceInterface.php @@ -0,0 +1,23 @@ +<?php +# Generated by the protocol buffer compiler (spiral/php-grpc). DO NOT EDIT! +# source: use_empty/service.proto + +namespace Test; + +use Spiral\GRPC; +use Google\Protobuf; + +interface ServiceInterface extends GRPC\ServiceInterface +{ + // GRPC specific service name. + public const NAME = "test.Service"; + + /** + * @param GRPC\ContextInterface $ctx + * @param Protobuf\GPBEmpty $in + * @return Protobuf\GPBEmpty + * + * @throws GRPC\Exception\InvokeException + */ + public function Test(GRPC\ContextInterface $ctx, Protobuf\GPBEmpty $in): Protobuf\GPBEmpty; +} diff --git a/tests/plugins/grpc/testdata/use_empty/service.proto b/tests/plugins/grpc/testdata/use_empty/service.proto new file mode 100644 index 00000000..8c68d8d3 --- /dev/null +++ b/tests/plugins/grpc/testdata/use_empty/service.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package test; + +import "google/protobuf/empty.proto"; + +service Service { + rpc Test (google.protobuf.Empty) returns (google.protobuf.Empty) { + } +}
\ No newline at end of file |