From 20b0212d4496d25df547e9d144336336f2486197 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Wed, 4 Oct 2023 23:51:41 +0400 Subject: [PATCH] Add more tests from roadrunner-temporal package --- tests/Functional/Client/TypedStubTestCase.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Functional/Client/TypedStubTestCase.php b/tests/Functional/Client/TypedStubTestCase.php index d1a9366d..cfe166a6 100644 --- a/tests/Functional/Client/TypedStubTestCase.php +++ b/tests/Functional/Client/TypedStubTestCase.php @@ -11,6 +11,7 @@ namespace Temporal\Tests\Functional\Client; +use Temporal\Exception\Client\WorkflowQueryException; use Temporal\Exception\InvalidArgumentException; use Temporal\Tests\DTO\Message; use Temporal\Tests\DTO\User; @@ -90,6 +91,26 @@ public function testQueryWorkflow() $this->assertSame(88, $e->getResult()); } + public function testQueryNotExistingMethod() + { + $client = $this->createClient(); + $simple = $client->newUntypedWorkflowStub('QueryWorkflow'); + + + $e = $client->start($simple, 'Hello World'); + $this->assertNotEmpty($e->getExecution()->getID()); + $this->assertNotEmpty($e->getExecution()->getRunID()); + + try { + $simple->query('error', -1); + } catch (WorkflowQueryException $e) { + $this->assertStringContainsString('KnownQueryTypes=[get]', $e->getPrevious()->getMessage()); + return; + } + + $this->fail('Expected exception to be thrown'); + } + public function testGetDTOResult() { $w = $this->createClient();