1111
1212namespace Temporal \Tests \Functional \Client ;
1313
14- use Temporal \Api \Enums \V1 \EventType ;
15- use Temporal \Api \History \V1 \HistoryEvent ;
1614use Temporal \Exception \Client \WorkflowFailedException ;
1715use Temporal \Exception \Failure \ActivityFailure ;
1816use Temporal \Tests \Workflow \SagaWorkflow ;
@@ -36,40 +34,8 @@ public function testGetResult()
3634 $ this ->assertInstanceOf (ActivityFailure::class, $ e ->getPrevious ());
3735 }
3836
39- $ this ->assertHistoryContains (
40- $ client ,
41- $ run ->getExecution (),
42- function (HistoryEvent $ e ) {
43- if ($ e ->getEventType () === EventType::EVENT_TYPE_ACTIVITY_TASK_SCHEDULED ) {
44- // compensation call
45- if (
46- $ e ->getActivityTaskScheduledEventAttributes ()->getActivityType ()->getName (
47- ) === 'SimpleActivity.lower '
48- ) {
49- return true ;
50- }
51- }
52-
53- return false ;
54- }
55- );
56-
57- $ this ->assertHistoryContains (
58- $ client ,
59- $ run ->getExecution (),
60- function (HistoryEvent $ e ) {
61- if ($ e ->getEventType () === EventType::EVENT_TYPE_ACTIVITY_TASK_SCHEDULED ) {
62- // compensation call
63- if (
64- $ e ->getActivityTaskScheduledEventAttributes ()->getActivityType ()->getName (
65- ) === 'SimpleActivity.prefix '
66- ) {
67- return true ;
68- }
69- }
70-
71- return false ;
72- }
73- );
37+ $ this ->assertHistoryContainsActivity ($ client , $ run ->getExecution (), 'SimpleActivity.echo ' );
38+ $ this ->assertHistoryContainsActivity ($ client , $ run ->getExecution (), 'SimpleActivity.lower ' );
39+ $ this ->assertHistoryContainsActivity ($ client , $ run ->getExecution (), 'SimpleActivity.prefix ' );
7440 }
7541}
0 commit comments