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 45 of file ilDataDetectorTest.php.
46 {
47
49
50
51
52 $this->assertTrue(
53 true,
54 'Construction failed with valid context passed to constructor.'
55 );
56 }
@noinspection PhpIncludeInspection
◆ testGetContext()
ilDataDetectorTest::testGetContext |
( |
| ) |
|
Definition at line 119 of file ilDataDetectorTest.php.
120 {
121
123
124
125 $actual = $detector->getContext();
126
127
128 if ($actual === $this->node) {
129 $this->assertEquals($actual, $this->node);
130 } else {
131 $this->assertTrue(false, 'Context not identical.');
132 }
133 }
◆ testSetDetectorState()
ilDataDetectorTest::testSetDetectorState |
( |
| ) |
|
Definition at line 58 of file ilDataDetectorTest.php.
59 {
60
64 $workflow->addNode($node);
65
66
67
68 $detector->setDetectorState(true);
69
70
71
72 $valid_state = true;
73
74 if (!$detector->getDetectorState()) {
75 $valid_state = false;
76 }
77
78 if ($node->isActive()) {
79
80
81
82
83 $valid_state = false;
84 }
85
86 $this->assertTrue($valid_state, 'Invalid state after setting of detector state.');
87 }
◆ testTrigger()
ilDataDetectorTest::testTrigger |
( |
| ) |
|
Definition at line 89 of file ilDataDetectorTest.php.
90 {
91
95 $workflow->addNode($node);
96
97
98
99 $detector->trigger(null);
100
101
102 $valid_state = true;
103
104 if (!$detector->getDetectorState()) {
105 $valid_state = false;
106 }
107
108 if ($node->isActive()) {
109
110
111
112
113 $valid_state = false;
114 }
115
116 $this->assertTrue($valid_state, 'Invalid state after setting of detector state.');
117 }
The documentation for this class was generated from the following file: