44
55namespace Tests \Unit ;
66
7+ use Exception as BaseException ;
8+ use InvalidArgumentException ;
9+ use RuntimeException ;
710use Tests \Fixtures \TestProbeBackToBackWorkflow ;
811use Tests \Fixtures \TestProbeChildFailureWorkflow ;
912use Tests \Fixtures \TestProbeParallelChildWorkflow ;
@@ -21,7 +24,7 @@ final class ExceptionTest extends TestCase
2124{
2225 public function testMiddleware (): void
2326 {
24- $ exception = new Exception (0 , now ()->toDateTimeString (), new StoredWorkflow (), new \ Exception (
27+ $ exception = new Exception (0 , now ()->toDateTimeString (), new StoredWorkflow (), new BaseException (
2528 'Test exception '
2629 ));
2730
@@ -42,7 +45,7 @@ public function testExceptionWorkflowRunning(): void
4245 'status ' => WorkflowRunningStatus::$ name ,
4346 ]);
4447
45- $ exception = new Exception (0 , now ()->toDateTimeString (), $ storedWorkflow , new \ Exception ('Test exception ' ));
48+ $ exception = new Exception (0 , now ()->toDateTimeString (), $ storedWorkflow , new BaseException ('Test exception ' ));
4649 $ exception ->handle ();
4750
4851 $ this ->assertSame (WorkflowRunningStatus::class, $ workflow ->status ());
@@ -64,14 +67,14 @@ public function testSkipsWriteWhenProbeDoesNotReachCandidateException(): void
6467 ->toDateTimeString (),
6568 'class ' => Exception::class,
6669 'result ' => Serializer::serialize ([
67- 'class ' => \Exception ::class,
70+ 'class ' => BaseException ::class,
6871 'message ' => 'child failed: child-1 ' ,
6972 'code ' => 0 ,
7073 ]),
7174 ]);
7275
7376 $ exception = new Exception (1 , now ()->toDateTimeString (), $ storedWorkflow , [
74- 'class ' => \Exception ::class,
77+ 'class ' => BaseException ::class,
7578 'message ' => 'child failed: child-2 ' ,
7679 'code ' => 0 ,
7780 ], sourceClass: TestProbeChildFailureWorkflow::class);
@@ -97,14 +100,14 @@ public function testPersistsWriteWhenProbeReachesCandidateException(): void
97100 ->toDateTimeString (),
98101 'class ' => Exception::class,
99102 'result ' => Serializer::serialize ([
100- 'class ' => \ RuntimeException::class,
103+ 'class ' => RuntimeException::class,
101104 'message ' => 'first failure ' ,
102105 'code ' => 0 ,
103106 ]),
104107 ]);
105108
106109 $ exception = new Exception (1 , now ()->toDateTimeString (), $ storedWorkflow , [
107- 'class ' => \ InvalidArgumentException::class,
110+ 'class ' => InvalidArgumentException::class,
108111 'message ' => 'second failure ' ,
109112 'code ' => 0 ,
110113 ], sourceClass: TestProbeRetryActivity::class);
0 commit comments