summaryrefslogtreecommitdiff
path: root/tests/temporal/Workflow/CancelledMidflightWorkflow.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/temporal/Workflow/CancelledMidflightWorkflow.php')
-rw-r--r--tests/temporal/Workflow/CancelledMidflightWorkflow.php47
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/temporal/Workflow/CancelledMidflightWorkflow.php b/tests/temporal/Workflow/CancelledMidflightWorkflow.php
deleted file mode 100644
index ea799ce1..00000000
--- a/tests/temporal/Workflow/CancelledMidflightWorkflow.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-
-namespace Temporal\Tests\Workflow;
-
-use Temporal\Activity\ActivityOptions;
-use Temporal\Tests\Activity\SimpleActivity;
-use Temporal\Workflow;
-use Temporal\Workflow\WorkflowMethod;
-
-#[Workflow\WorkflowInterface]
-class CancelledMidflightWorkflow
-{
- private array $status = [];
-
- #[Workflow\QueryMethod(name: 'getStatus')]
- public function getStatus(): array
- {
- return $this->status;
- }
-
- #[WorkflowMethod(name: 'CancelledMidflightWorkflow')]
- public function handler()
- {
- $simple = Workflow::newActivityStub(
- SimpleActivity::class,
- ActivityOptions::new()->withStartToCloseTimeout(5)
- );
-
- $this->status[] = 'start';
-
- $scope = Workflow::newCancellationScope(
- function () use ($simple) {
- $this->status[] = 'in scope';
- $simple->slow('1');
- }
- )->onCancel(
- function () {
- $this->status[] = 'on cancel';
- }
- );
-
- $scope->cancel();
- $this->status[] = 'done cancel';
-
- return 'OK';
- }
-}