ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
LinearWorkflowTest Class Reference
+ Inheritance diagram for LinearWorkflowTest:
+ Collaboration diagram for LinearWorkflowTest:

Public Member Functions

 setUp ()
 
 testImplementsFactoryInterface ()
 
 testConstructorParams ()
 
 testConstructor ()
 
 testAmountOfSteps ()
 
 testActive ()
 
 testWithActiveThrows ()
 

Protected Member Functions

 buildFactory ()
 

Protected Attributes

string $title
 
array $steps
 
Workflow Linear $wf
 

Detailed Description

Definition at line 26 of file LinearWorkflowTest.php.

Member Function Documentation

◆ buildFactory()

LinearWorkflowTest::buildFactory ( )
protected

Definition at line 32 of file LinearWorkflowTest.php.

Referenced by setUp().

+ Here is the caller graph for this function:

◆ setUp()

LinearWorkflowTest::setUp ( )

Definition at line 37 of file LinearWorkflowTest.php.

References Vendor\Package\$f, and buildFactory().

37  : void
38  {
39  $f = $this->buildFactory();
40  $this->title = 'title';
41  $this->steps = [
42  $f->step(''),
43  $f->step('')
44  ];
45  $this->wf = $f->linear($this->title, $this->steps);
46  }
+ Here is the call graph for this function:

◆ testActive()

LinearWorkflowTest::testActive ( )

Definition at line 72 of file LinearWorkflowTest.php.

72  : void
73  {
74  $wf = $this->wf->withActive(1);
75  $this->assertEquals(1, $wf->getActive());
76  }
withActive(int $active)
The step at this position is set to active.
getActive()
This is the index of the active step.

◆ testAmountOfSteps()

LinearWorkflowTest::testAmountOfSteps ( )

Definition at line 67 of file LinearWorkflowTest.php.

67  : void
68  {
69  $this->assertEquals(count($this->steps), $this->wf->getAmountOfSteps());
70  }

◆ testConstructor()

LinearWorkflowTest::testConstructor ( )

Definition at line 60 of file LinearWorkflowTest.php.

60  : void
61  {
62  $this->assertEquals($this->title, $this->wf->getTitle());
63  $this->assertEquals($this->steps, $this->wf->getSteps());
64  $this->assertEquals(0, $this->wf->getActive());
65  }

◆ testConstructorParams()

LinearWorkflowTest::testConstructorParams ( )

Definition at line 53 of file LinearWorkflowTest.php.

53  : void
54  {
55  $this->assertEquals($this->title, $this->wf->getTitle());
56  $this->assertEquals($this->steps, $this->wf->getSteps());
57  $this->assertEquals(0, $this->wf->getActive());
58  }

◆ testImplementsFactoryInterface()

LinearWorkflowTest::testImplementsFactoryInterface ( )

Definition at line 48 of file LinearWorkflowTest.php.

48  : void
49  {
50  $this->assertInstanceOf(Workflow\Workflow::class, $this->wf);
51  }

◆ testWithActiveThrows()

LinearWorkflowTest::testWithActiveThrows ( )

Definition at line 78 of file LinearWorkflowTest.php.

References Vendor\Package\$e.

78  : void
79  {
80  $raised = false;
81  try {
82  $this->wf->withActive(-1);
83  $this->assertFalse("This should not happen.");
84  } catch (InvalidArgumentException $e) {
85  $raised = true;
86  }
87  $this->assertTrue($raised);
88 
89  $raised = false;
90  try {
91  $this->wf->withActive(2);
92  $this->assertFalse("This should not happen.");
93  } catch (InvalidArgumentException $e) {
94  $raised = true;
95  }
96  $this->assertTrue($raised);
97  }

Field Documentation

◆ $steps

array LinearWorkflowTest::$steps
protected

Definition at line 29 of file LinearWorkflowTest.php.

◆ $title

string LinearWorkflowTest::$title
protected

Definition at line 28 of file LinearWorkflowTest.php.

◆ $wf

Workflow Linear LinearWorkflowTest::$wf
protected

Definition at line 30 of file LinearWorkflowTest.php.


The documentation for this class was generated from the following file: