From 70d1244aed4c044cf9cc1663d2dfc727d39b7df3 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 20 Jan 2025 19:48:29 +0400 Subject: [PATCH] Add simple `initMethod` test --- .../Extra/Workflow/InitMethodTest.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tests/Acceptance/Extra/Workflow/InitMethodTest.php diff --git a/tests/Acceptance/Extra/Workflow/InitMethodTest.php b/tests/Acceptance/Extra/Workflow/InitMethodTest.php new file mode 100644 index 00000000..f4b15a53 --- /dev/null +++ b/tests/Acceptance/Extra/Workflow/InitMethodTest.php @@ -0,0 +1,54 @@ +assertTrue($stub->getResult(timeout: 5)); + } +} + +#[WorkflowInterface] +class TestWorkflow +{ + private array $initInput; + + #[InitMethod] + public function __construct(Input $input) { + $this->initInput = \func_get_args(); + } + + #[WorkflowMethod(name: "Extra_Workflow_InitMethod")] + public function handle(Input $input) + { + return $this->initInput === \func_get_args(); + } +} + +class Input +{ + public function __construct( + public string $name, + public int $age, + ) {} +}