File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,9 @@ final class WorkflowInfo
105105 #[Marshal(name: 'ParentWorkflowNamespace ' )]
106106 public ?string $ parentNamespace = null ;
107107
108+ #[Marshal(name: 'RootWorkflowExecution ' , type: NullableType::class, of: WorkflowExecution::class)]
109+ public ?WorkflowExecution $ rootExecution = null ;
110+
108111 #[Marshal(name: 'ParentWorkflowExecution ' , type: NullableType::class, of: WorkflowExecution::class)]
109112 public ?WorkflowExecution $ parentExecution = null ;
110113
Original file line number Diff line number Diff line change @@ -17,8 +17,11 @@ class RootWorkflowExecutionTest extends TestCase
1717 #[Test]
1818 public static function check (#[Stub('Extra_Workflow_RootWorkflowExecution ' )]WorkflowStubInterface $ stub ): void
1919 {
20- self ::markTestSkipped ('Waiting https://github.com/temporalio/sdk-go/issues/1848 ' );
21- self ::assertSame ('Test ' , $ stub ->getResult ());
20+ $ result = $ stub ->getResult (type: 'array ' );
21+ self ::assertSame ([
22+ 'ID ' => $ stub ->getExecution ()->getID (),
23+ 'RunID ' => $ stub ->getExecution ()->getRunID (),
24+ ], $ result );
2225 }
2326}
2427
@@ -37,19 +40,19 @@ public function run()
3740class ChildWorkflow
3841{
3942 #[WorkflowMethod('Extra_Workflow_RootWorkflowExecution_Child ' )]
40- public function run (string $ input )
43+ public function run ()
4144 {
4245 return yield Workflow::newChildWorkflowStub (ChildWorkflow2::class)
43- ->run ($ input );
46+ ->run ();
4447 }
4548}
4649
4750#[WorkflowInterface]
4851class ChildWorkflow2
4952{
5053 #[WorkflowMethod('Extra_Workflow_RootWorkflowExecution_Child2 ' )]
51- public function run (string $ input )
54+ public function run ()
5255 {
53- return $ input ;
56+ return Workflow:: getCurrentContext ()-> getInfo ()-> rootExecution ;
5457 }
5558}
You can’t perform that action at this time.
0 commit comments