19declare(strict_types=1);
21require_once(__DIR__ .
"/../../../../../../../vendor/composer/vendor/autoload.php");
22require_once(__DIR__ .
"/../../../Base.php");
30 protected Workflow\Linear
$wf;
40 $this->title =
'title';
45 $this->wf =
$f->linear($this->title, $this->steps);
50 $this->assertInstanceOf(
Workflow\Workflow::class, $this->wf);
55 $this->assertEquals($this->title, $this->wf->getTitle());
56 $this->assertEquals($this->steps, $this->wf->getSteps());
57 $this->assertEquals(0, $this->wf->getActive());
62 $this->assertEquals($this->title, $this->wf->getTitle());
63 $this->assertEquals($this->steps, $this->wf->getSteps());
64 $this->assertEquals(0, $this->wf->getActive());
69 $this->assertEquals(count($this->steps), $this->wf->getAmountOfSteps());
82 $this->wf->withActive(-1);
83 $this->assertFalse(
"This should not happen.");
84 }
catch (InvalidArgumentException
$e) {
87 $this->assertTrue($raised);
91 $this->wf->withActive(2);
92 $this->assertFalse(
"This should not happen.");
93 }
catch (InvalidArgumentException
$e) {
96 $this->assertTrue($raised);
102 <div
class=
"il-workflow linear" id=
"id_1">
103 <div
class=
"il-workflow-header">
104 <h3
class=
"il-workflow-title">title</h3>
106 <ul
class=
"il-workflow-container">
107 <li
class=
"il-workflow-step first available not-started">
109 <span
class=
"il-workflow-step-label"></span>
110 <span
class=
"il-workflow-step-description"></span>
113 <li
class=
"il-workflow-step last active not-started">
115 <span
class=
"il-workflow-step-label"></span>
116 <span
class=
"il-workflow-step-description"></span>
122 $actual = $this->getDefaultRenderer()->render(
$wf = $this->wf->
withActive(1));
124 $this->brutallyTrimHTML($expected),
125 $this->brutallyTrimHTML($actual),
Provides common functionality for UI tests.
testLinearWorkflowRendering()
testImplementsFactoryInterface()
This is the interface for a workflow factory.
This describes a Workflow.
withActive(int $active)
The step at this position is set to active.
getActive()
This is the index of the active step.