File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 <include >
1616 <directory >src</directory >
1717 </include >
18+ <exclude >
19+ <directory >src/State/ExecutionLog/OutputFormat</directory >
20+ </exclude >
1821 </coverage >
1922 <testsuite name =" PHPWorkflow" >
2023 <directory >tests</directory >
Original file line number Diff line number Diff line change 88use PHPUnit \Framework \TestCase ;
99use PHPWorkflow \State \WorkflowContainer ;
1010use PHPWorkflow \Step \Loop ;
11- use PHPWorkflow \Step \LoopControl ;
1211use PHPWorkflow \Step \NestedWorkflow ;
13- use PHPWorkflow \Step \WorkflowStep ;
1412use PHPWorkflow \Workflow ;
1513use PHPWorkflow \WorkflowControl ;
1614
@@ -797,33 +795,4 @@ public function failStepDataProvider(): array
797795 'By failing step ' => [fn (WorkflowControl $ control ) => $ control ->failStep ('Fail Message ' )],
798796 ];
799797 }
800-
801- private function entryLoopControl (): LoopControl
802- {
803- return $ this ->setupLoop (
804- 'process-loop ' ,
805- function (WorkflowControl $ control , WorkflowContainer $ container ): bool {
806- $ entries = $ container ->get ('entries ' );
807-
808- if (empty ($ entries )) {
809- return false ;
810- }
811-
812- $ container ->set ('entry ' , array_shift ($ entries ));
813- $ container ->set ('entries ' , $ entries );
814-
815- return true ;
816- },
817- );
818- }
819-
820- private function processEntry (): WorkflowStep
821- {
822- return $ this ->setupStep (
823- 'process-test ' ,
824- function (WorkflowControl $ control , WorkflowContainer $ container ) {
825- $ control ->attachStepInfo ("Process entry " . $ container ->get ('entry ' ));
826- },
827- );
828- }
829798}
Original file line number Diff line number Diff line change 66
77use PHPUnit \Framework \TestCase ;
88use PHPWorkflow \State \ExecutionLog \OutputFormat \GraphViz ;
9+ use PHPWorkflow \State \ExecutionLog \OutputFormat \WorkflowGraph ;
10+ use PHPWorkflow \State \WorkflowContainer ;
11+ use PHPWorkflow \Step \Loop ;
12+ use PHPWorkflow \Step \NestedWorkflow ;
913use PHPWorkflow \Workflow ;
14+ use PHPWorkflow \WorkflowControl ;
1015
1116/**
1217 * Class OutputFormatterTest
@@ -17,7 +22,7 @@ class OutputFormatterTest extends TestCase
1722{
1823 use WorkflowTestTrait, WorkflowSetupTrait;
1924
20- public function testCustomOutputFormatter (): void
25+ public function testGraphVizOutputFormatter (): void
2126 {
2227 $ result = (new Workflow ('test ' ))
2328 ->process ($ this ->setupEmptyStep ('process-test ' ))
Original file line number Diff line number Diff line change @@ -67,6 +67,35 @@ public function executeNextIteration(
6767 };
6868 }
6969
70+ private function entryLoopControl (): LoopControl
71+ {
72+ return $ this ->setupLoop (
73+ 'process-loop ' ,
74+ function (WorkflowControl $ control , WorkflowContainer $ container ): bool {
75+ $ entries = $ container ->get ('entries ' );
76+
77+ if (empty ($ entries )) {
78+ return false ;
79+ }
80+
81+ $ container ->set ('entry ' , array_shift ($ entries ));
82+ $ container ->set ('entries ' , $ entries );
83+
84+ return true ;
85+ },
86+ );
87+ }
88+
89+ private function processEntry (): WorkflowStep
90+ {
91+ return $ this ->setupStep (
92+ 'process-test ' ,
93+ function (WorkflowControl $ control , WorkflowContainer $ container ) {
94+ $ control ->attachStepInfo ("Process entry " . $ container ->get ('entry ' ));
95+ },
96+ );
97+ }
98+
7099 public function failDataProvider (): array
71100 {
72101 return [
You can’t perform that action at this time.
0 commit comments