|
9 | 9 | use Tests\Fixtures\TestParentWorkflow; |
10 | 10 | use Tests\TestCase; |
11 | 11 | use Workflow\ChildWorkflowStub; |
12 | | -use Workflow\Exceptions\TransitionNotFound; |
13 | 12 | use Workflow\Models\StoredWorkflow; |
14 | 13 | use Workflow\Serializers\Serializer; |
15 | 14 | use Workflow\States\WorkflowPendingStatus; |
@@ -92,33 +91,18 @@ public function testLoadsChildWorkflow(): void |
92 | 91 | $this->assertNull($result); |
93 | 92 | } |
94 | 93 |
|
95 | | - public function testIgnoresTransitionNotFoundWhenChildResumeThrows(): void |
| 94 | + public function testDoesNotResumeRunningStartedChildWorkflow(): void |
96 | 95 | { |
97 | | - $childWorkflow = new class() { |
98 | | - public function running(): bool |
99 | | - { |
100 | | - return true; |
101 | | - } |
102 | | - |
103 | | - public function created(): bool |
104 | | - { |
105 | | - return false; |
106 | | - } |
107 | | - |
108 | | - public function resume(): void |
109 | | - { |
110 | | - throw TransitionNotFound::make('running', 'pending', StoredWorkflow::class); |
111 | | - } |
112 | | - |
113 | | - public function completed(): bool |
114 | | - { |
115 | | - return false; |
116 | | - } |
117 | | - |
118 | | - public function startAsChild(...$arguments): void |
119 | | - { |
120 | | - } |
121 | | - }; |
| 96 | + $childWorkflow = Mockery::mock(); |
| 97 | + $childWorkflow->shouldReceive('running') |
| 98 | + ->once() |
| 99 | + ->andReturn(true); |
| 100 | + $childWorkflow->shouldReceive('created') |
| 101 | + ->once() |
| 102 | + ->andReturn(false); |
| 103 | + $childWorkflow->shouldNotReceive('completed'); |
| 104 | + $childWorkflow->shouldNotReceive('resume'); |
| 105 | + $childWorkflow->shouldNotReceive('startAsChild'); |
122 | 106 |
|
123 | 107 | $storedChildWorkflow = Mockery::mock(); |
124 | 108 | $storedChildWorkflow->status = new \stdClass(); |
|
0 commit comments