ilDataDetectorTest is part of the petri net based workflow engine.
More...
ilDataDetectorTest is part of the petri net based workflow engine.
This class holds all tests for the class detectors/class.ilDataDetector
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 15 of file ilDataDetectorTest.php.
◆ setUp()
ilDataDetectorTest::setUp |
( |
| ) |
|
Definition at line 17 of file ilDataDetectorTest.php.
18 {
19 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
20
21
22
23 require_once './Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
25
26
27 require_once './Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
29
30
31 $this->workflow->addNode($this->node);
32
33 require_once './Services/WorkflowEngine/classes/detectors/class.ilDataDetector.php';
34 }
@noinspection PhpIncludeInspection
@noinspection PhpIncludeInspection
◆ tearDown()
ilDataDetectorTest::tearDown |
( |
| ) |
|
◆ testConstructorValidContext()
ilDataDetectorTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 46 of file ilDataDetectorTest.php.
47 {
48
50
51
52
53 $this->assertTrue(
54 true,
55 'Construction failed with valid context passed to constructor.'
56 );
57 }
@noinspection PhpIncludeInspection
◆ testGetContext()
ilDataDetectorTest::testGetContext |
( |
| ) |
|
Definition at line 124 of file ilDataDetectorTest.php.
125 {
126
128
129
130 $actual = $detector->getContext();
131
132
133 if ($actual === $this->node)
134 {
135 $this->assertEquals($actual, $this->node);
136 } else {
137 $this->assertTrue(false, 'Context not identical.');
138 }
139 }
◆ testSetDetectorState()
ilDataDetectorTest::testSetDetectorState |
( |
| ) |
|
Definition at line 59 of file ilDataDetectorTest.php.
60 {
61
65 $workflow->addNode($node);
66
67
68
69 $detector->setDetectorState(true);
70
71
72
73 $valid_state = true;
74
75 if (!$detector->getDetectorState())
76 {
77 $valid_state = false;
78 }
79
80 if ($node->isActive())
81 {
82
83
84
85
86 $valid_state = false;
87 }
88
89 $this->assertTrue($valid_state, 'Invalid state after setting of detector state.');
90 }
◆ testTrigger()
ilDataDetectorTest::testTrigger |
( |
| ) |
|
Definition at line 92 of file ilDataDetectorTest.php.
93 {
94
98 $workflow->addNode($node);
99
100
101
102 $detector->trigger(null);
103
104
105 $valid_state = true;
106
107 if (!$detector->getDetectorState())
108 {
109 $valid_state = false;
110 }
111
112 if ($node->isActive())
113 {
114
115
116
117
118 $valid_state = false;
119 }
120
121 $this->assertTrue($valid_state, 'Invalid state after setting of detector state.');
122 }
The documentation for this class was generated from the following file: