summaryrefslogtreecommitdiff
path: root/tests/temporal/Workflow/CanceledHeartbeatWorkflow.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/temporal/Workflow/CanceledHeartbeatWorkflow.php')
-rw-r--r--tests/temporal/Workflow/CanceledHeartbeatWorkflow.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/temporal/Workflow/CanceledHeartbeatWorkflow.php b/tests/temporal/Workflow/CanceledHeartbeatWorkflow.php
new file mode 100644
index 00000000..6b463192
--- /dev/null
+++ b/tests/temporal/Workflow/CanceledHeartbeatWorkflow.php
@@ -0,0 +1,29 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Temporal\Tests\Workflow;
+
+use Temporal\Activity\ActivityCancellationType;
+use Temporal\Activity\ActivityOptions;
+use Temporal\Workflow;
+use Temporal\Workflow\WorkflowMethod;
+use Temporal\Tests\Activity\HeartBeatActivity;
+
+#[Workflow\WorkflowInterface]
+class CanceledHeartbeatWorkflow
+{
+ #[WorkflowMethod(name: 'CanceledHeartbeatWorkflow')]
+ public function handler(): iterable
+ {
+ $act = Workflow::newActivityStub(
+ HeartBeatActivity::class,
+ ActivityOptions::new()
+ ->withStartToCloseTimeout(50)
+ ->withCancellationType(ActivityCancellationType::WAIT_CANCELLATION_COMPLETED)
+ ->withHeartbeatTimeout(1)
+ );
+
+ return yield $act->slow('test');
+ }
+}