ILIAS  release_8 Revision v8.24
LinearWorkflowTest Class Reference
+ Inheritance diagram for LinearWorkflowTest:
+ Collaboration diagram for LinearWorkflowTest:

Public Member Functions

 setUp ()
 
 test_implements_factory_interface ()
 
 test_constructor_params ()
 
 test_constructor ()
 
 test_amount_of_steps ()
 
 test_active ()
 
 test_withActive_throws ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Protected Member Functions

 buildFactory ()
 
- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

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 ( )

Reimplemented from ILIAS_UI_TestBase.

Definition at line 37 of file LinearWorkflowTest.php.

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 }

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

+ Here is the call graph for this function:

◆ test_active()

LinearWorkflowTest::test_active ( )

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.

References $wf, ILIAS\UI\Component\Listing\Workflow\Workflow\getActive(), and ILIAS\UI\Component\Listing\Workflow\Workflow\withActive().

+ Here is the call graph for this function:

◆ test_amount_of_steps()

LinearWorkflowTest::test_amount_of_steps ( )

Definition at line 67 of file LinearWorkflowTest.php.

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

◆ test_constructor()

LinearWorkflowTest::test_constructor ( )

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 }

◆ test_constructor_params()

LinearWorkflowTest::test_constructor_params ( )

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 }

◆ test_implements_factory_interface()

LinearWorkflowTest::test_implements_factory_interface ( )

Definition at line 48 of file LinearWorkflowTest.php.

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

◆ test_withActive_throws()

LinearWorkflowTest::test_withActive_throws ( )

Definition at line 78 of file LinearWorkflowTest.php.

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 }

References Vendor\Package\$e.

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.

Referenced by test_active().


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