19 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
23 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
30 if ($ilSetting != NULL)
32 $ilSetting->delete(
'IL_PHPUNIT_TEST_TIME');
33 $ilSetting->delete(
'IL_PHPUNIT_TEST_MICROTIME');
46 'Construction failed with valid context passed to constructor.' 56 $actual = $node->getContext();
59 if ($actual === $this->workflow)
61 $this->assertEquals($actual, $this->workflow);
63 $this->assertTrue(
false,
'Context not identical.');
71 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
73 $node->addDetector($detector);
79 $actual = $node->isActive();
80 $this->assertTrue($actual);
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);
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);
121 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
123 $node->addDetector($detector);
127 $preconditions = $node->checkTransitionPreconditions();
130 $this->assertFalse($preconditions);
137 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
139 $node->addDetector($detector);
142 $detector->trigger(
array());
143 $result = $node->attemptTransition();
153 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
155 $node->addDetector($detector);
158 $result = $node->attemptTransition();
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);
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');
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());
246 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
250 $node->addDetector($detector);
251 $detectors = $node->getDetectors();
254 $this->assertEquals($detector, $detectors[0]);
261 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilSimpleEmitter.php';
265 $node->addEmitter($emitter);
266 $emitters = $node->getEmitters();
269 $this->assertEquals($emitter, $emitters[0]);
276 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
280 $node->addActivity($activity);
281 $activities = $node->getActivities();
284 $this->assertEquals($activity, $activities[0]);
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());
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.');
testConstructorValidContext()
testExecuteActivitiesViaExecuteTransition()
testCheckTransitionPreconditionsValid()
ilBasicNodeTest is part of the petri net based workflow engine.
testExecuteEmitterViaExecuteTransition()
testAttemptTransitionInvalid()
testCheckTransitionPreconditionsInvalid()
testSetGetIsForwardConditionNode()
testIsActiveAndActivate()
Create styles array
The data for the language used.
testNotifyDetectorSatisfaction()
testAttemptTransitionValid()