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);
Provides common functionality for UI tests.
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.