Skip to content

Commit 2456aa1

Browse files
committed
Fix signal replay
1 parent eeab712 commit 2456aa1

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

tests/Fixtures/TestParentWorkflow.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66

77
use Workflow\ActivityStub;
88
use Workflow\ChildWorkflowStub;
9+
use Workflow\SignalMethod;
910
use Workflow\Workflow;
1011

1112
class TestParentWorkflow extends Workflow
1213
{
14+
#[SignalMethod]
15+
public function ping(): void
16+
{
17+
// Do nothing
18+
}
19+
1320
public function execute()
1421
{
1522
$otherResult = yield ChildWorkflowStub::make(TestChildWorkflow::class);

tests/Unit/WorkflowTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ public function testParentPending(): void
255255
'result' => Serializer::serialize('activity'),
256256
]);
257257

258+
$storedParentWorkflow->signals()
259+
->create([
260+
'method' => 'ping',
261+
'arguments' => Serializer::serialize([]),
262+
'created_at' => now()
263+
->addSeconds(1),
264+
]);
265+
258266
$childWorkflow = WorkflowStub::load(WorkflowStub::make(TestChildWorkflow::class)->id());
259267

260268
$storedChildWorkflow = StoredWorkflow::findOrFail($childWorkflow->id());

0 commit comments

Comments
 (0)