ilBasicNodeTest is part of the petri net based workflow engine.
More...
ilBasicNodeTest is part of the petri net based workflow engine.
This class holds all tests for the class nodes/class.ilBasicNode
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 15 of file ilBasicNodeTest.php.
◆ setUp()
ilBasicNodeTest::setUp |
( |
| ) |
|
Definition at line 17 of file ilBasicNodeTest.php.
19 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
23 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
◆ tearDown()
ilBasicNodeTest::tearDown |
( |
| ) |
|
Definition at line 27 of file ilBasicNodeTest.php.
References $ilSetting.
30 if ($ilSetting != NULL)
32 $ilSetting->delete(
'IL_PHPUNIT_TEST_TIME');
33 $ilSetting->delete(
'IL_PHPUNIT_TEST_MICROTIME');
◆ testAddActivity()
ilBasicNodeTest::testAddActivity |
( |
| ) |
|
Definition at line 272 of file ilBasicNodeTest.php.
276 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
280 $node->addActivity($activity);
281 $activities = $node->getActivities();
284 $this->assertEquals($activity, $activities[0]);
◆ testAddDetector()
ilBasicNodeTest::testAddDetector |
( |
| ) |
|
Definition at line 242 of file ilBasicNodeTest.php.
246 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
250 $node->addDetector($detector);
251 $detectors = $node->getDetectors();
254 $this->assertEquals($detector, $detectors[0]);
◆ testAddEmitter()
ilBasicNodeTest::testAddEmitter |
( |
| ) |
|
Definition at line 257 of file ilBasicNodeTest.php.
261 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilSimpleEmitter.php';
265 $node->addEmitter($emitter);
266 $emitters = $node->getEmitters();
269 $this->assertEquals($emitter, $emitters[0]);
◆ testAttemptTransitionInvalid()
ilBasicNodeTest::testAttemptTransitionInvalid |
( |
| ) |
|
Definition at line 149 of file ilBasicNodeTest.php.
References $result.
153 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
155 $node->addDetector($detector);
158 $result = $node->attemptTransition();
◆ testAttemptTransitionValid()
ilBasicNodeTest::testAttemptTransitionValid |
( |
| ) |
|
Definition at line 133 of file ilBasicNodeTest.php.
References $result, and array.
137 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
139 $node->addDetector($detector);
142 $detector->trigger(
array());
143 $result = $node->attemptTransition();
Create styles array
The data for the language used.
◆ testCheckTransitionPreconditionsInvalid()
ilBasicNodeTest::testCheckTransitionPreconditionsInvalid |
( |
| ) |
|
Definition at line 117 of file ilBasicNodeTest.php.
121 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
123 $node->addDetector($detector);
127 $preconditions = $node->checkTransitionPreconditions();
130 $this->assertFalse($preconditions);
◆ testCheckTransitionPreconditionsValid()
ilBasicNodeTest::testCheckTransitionPreconditionsValid |
( |
| ) |
|
Definition at line 101 of file ilBasicNodeTest.php.
References array.
105 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
107 $node->addDetector($detector);
110 $detector->trigger(
array());
111 $preconditions = $node->checkTransitionPreconditions();
114 $this->assertTrue($preconditions);
Create styles array
The data for the language used.
◆ testConstructorValidContext()
ilBasicNodeTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 37 of file ilBasicNodeTest.php.
46 'Construction failed with valid context passed to constructor.'
◆ testDeactivate()
ilBasicNodeTest::testDeactivate |
( |
| ) |
|
Definition at line 83 of file ilBasicNodeTest.php.
87 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
89 $node->addDetector($detector);
93 $was_activated = $node->isActive();
95 $was_deactivated = !$node->isActive();
98 $this->assertEquals($was_activated, $was_deactivated);
◆ testExecuteActivitiesViaExecuteTransition()
ilBasicNodeTest::testExecuteActivitiesViaExecuteTransition |
( |
| ) |
|
Definition at line 183 of file ilBasicNodeTest.php.
187 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
189 $node->addDetector($detector);
191 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
193 $activity->setLogFile(
'ilTransitionLog.txt');
194 $activity->setLogLevel(
'MESSAGE');
195 $activity->setLogMessage(
'TEST');
196 $node->addActivity($activity);
200 $node->executeTransition();
203 $expected =
' :: MESSAGE :: TEST';
204 $fp = fopen(
'ilTransitionLog.txt', r);
206 $actual = substr($line, 25, strlen($line)-27);
207 @unlink(
'ilTransitionLog.txt');
◆ testExecuteEmitterViaExecuteTransition()
ilBasicNodeTest::testExecuteEmitterViaExecuteTransition |
( |
| ) |
|
Definition at line 214 of file ilBasicNodeTest.php.
218 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
220 $node->addDetector($detector);
222 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilActivationEmitter.php';
225 $t_node->addDetector($t_detector);
227 $t_node->addDetector($foo_detector);
231 $emitter->setTargetDetector($t_detector);
232 $node->addEmitter($emitter);
236 $node->executeTransition();
239 $this->assertTrue($t_node->isActive());
◆ testExecuteTransition()
ilBasicNodeTest::testExecuteTransition |
( |
| ) |
|
Definition at line 164 of file ilBasicNodeTest.php.
170 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
172 $node->addDetector($detector);
176 $node->executeTransition();
177 $state = $node->isActive();
180 $this->assertFalse($state);
◆ testGetContext()
ilBasicNodeTest::testGetContext |
( |
| ) |
|
Definition at line 50 of file ilBasicNodeTest.php.
56 $actual = $node->getContext();
59 if ($actual === $this->workflow)
61 $this->assertEquals($actual, $this->workflow);
63 $this->assertTrue(
false,
'Context not identical.');
◆ testIsActiveAndActivate()
ilBasicNodeTest::testIsActiveAndActivate |
( |
| ) |
|
Definition at line 67 of file ilBasicNodeTest.php.
71 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
73 $node->addDetector($detector);
79 $actual = $node->isActive();
80 $this->assertTrue($actual);
◆ testNotifyDetectorSatisfaction()
ilBasicNodeTest::testNotifyDetectorSatisfaction |
( |
| ) |
|
Definition at line 287 of file ilBasicNodeTest.php.
292 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
294 $node->addDetector($detector);
299 $detector->setDetectorState(
true);
308 $node->notifyDetectorSatisfaction($detector);
311 $this->assertFalse($node->isActive());
◆ testSetGetIsForwardConditionNode()
ilBasicNodeTest::testSetGetIsForwardConditionNode |
( |
| ) |
|
Definition at line 314 of file ilBasicNodeTest.php.
318 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
320 $node->addDetector($detector);
326 $this->assertFalse($node->isForwardConditionNode(),
'Forward condition should be false by default.');
327 $node->setIsForwardConditionNode(
true);
328 $this->assertTrue($node->isForwardConditionNode(),
'Forward condition node state not properly stored.');
The documentation for this class was generated from the following file: