File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ public static function config(): StateConfig
1414 return parent ::config ()
1515 ->default (WorkflowCreatedStatus::class)
1616 ->allowTransition (WorkflowCreatedStatus::class, WorkflowPendingStatus::class)
17- ->allowTransition (WorkflowFailedStatus::class, WorkflowPendingStatus::class)
1817 ->allowTransition (WorkflowPendingStatus::class, WorkflowFailedStatus::class)
1918 ->allowTransition (WorkflowPendingStatus::class, WorkflowRunningStatus::class)
2019 ->allowTransition (WorkflowRunningStatus::class, WorkflowCompletedStatus::class)
Original file line number Diff line number Diff line change 66
77use Tests \Fixtures \TestFailingWorkflow ;
88use Tests \TestCase ;
9+ use Workflow \Models \StoredWorkflow ;
910use Workflow \States \WorkflowCompletedStatus ;
11+ use Workflow \States \WorkflowCreatedStatus ;
1012use Workflow \States \WorkflowFailedStatus ;
1113use Workflow \WorkflowStub ;
1214
@@ -23,6 +25,10 @@ public function testRetry(): void
2325 $ this ->assertSame (WorkflowFailedStatus::class, $ workflow ->status ());
2426 $ this ->assertNull ($ workflow ->output ());
2527
28+ $ storedWorkflow = StoredWorkflow::findOrFail ($ workflow ->id ());
29+ $ storedWorkflow ->status = WorkflowCreatedStatus::class;
30+ $ storedWorkflow ->save ();
31+
2632 $ workflow ->fresh ()
2733 ->start (shouldFail: false );
2834
Original file line number Diff line number Diff line change 1414use Tests \Fixtures \TestParentWorkflow ;
1515use Tests \TestCase ;
1616use Workflow \AsyncWorkflow ;
17+ use Workflow \Models \StoredWorkflow ;
1718use Workflow \States \WorkflowCompletedStatus ;
19+ use Workflow \States \WorkflowCreatedStatus ;
1820use Workflow \States \WorkflowFailedStatus ;
1921use Workflow \WorkflowStub ;
2022
@@ -48,6 +50,14 @@ public function testRetry(): void
4850 $ this ->assertSame (WorkflowFailedStatus::class, $ workflow ->status ());
4951 $ this ->assertNull ($ workflow ->output ());
5052
53+ $ storedWorkflow = StoredWorkflow::findOrFail ($ workflow ->id ());
54+ $ storedWorkflow ->status = WorkflowCreatedStatus::class;
55+ $ storedWorkflow ->save ();
56+
57+ $ storedChildWorkflow = StoredWorkflow::findOrFail ($ workflow ->id () + 1 );
58+ $ storedChildWorkflow ->status = WorkflowCreatedStatus::class;
59+ $ storedChildWorkflow ->save ();
60+
5161 $ workflow ->fresh ()
5262 ->start (shouldThrow: false );
5363
Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ public function testMake(): void
5757 $ this ->assertTrue ($ workflow ->failed ());
5858 $ this ->assertTrue ($ parentWorkflow ->failed ());
5959
60+ $ storedWorkflow = StoredWorkflow::findOrFail ($ workflow ->id ());
61+ $ storedWorkflow ->status = WorkflowCreatedStatus::class;
62+ $ storedWorkflow ->save ();
63+
6064 $ workflow ->cancel ();
6165 while (! $ workflow ->isCanceled ());
6266
@@ -78,6 +82,10 @@ public function testComplete(): void
7882 $ workflow ->cancel ();
7983 $ workflow ->fail (new Exception ('resume ' ));
8084
85+ $ storedWorkflow = StoredWorkflow::findOrFail ($ workflow ->id ());
86+ $ storedWorkflow ->status = WorkflowCreatedStatus::class;
87+ $ storedWorkflow ->save ();
88+
8189 Cache::flush ();
8290
8391 $ workflow ->resume ();
You can’t perform that action at this time.
0 commit comments