19 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
23 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
30 if ($ilSetting != null) {
31 $ilSetting->delete(
'IL_PHPUNIT_TEST_TIME');
32 $ilSetting->delete(
'IL_PHPUNIT_TEST_MICROTIME');
45 'Construction failed with valid context passed to constructor.' 55 $actual = $node->getContext();
58 if ($actual === $this->workflow) {
59 $this->assertEquals($actual, $this->workflow);
61 $this->assertTrue(
false,
'Context not identical.');
69 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
71 $node->addDetector($detector);
77 $actual = $node->isActive();
78 $this->assertTrue($actual);
85 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
87 $node->addDetector($detector);
91 $was_activated = $node->isActive();
93 $was_deactivated = !$node->isActive();
96 $this->assertEquals($was_activated, $was_deactivated);
103 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
105 $node->addDetector($detector);
108 $detector->trigger(array());
109 $preconditions = $node->checkTransitionPreconditions();
112 $this->assertTrue($preconditions);
119 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
121 $node->addDetector($detector);
125 $preconditions = $node->checkTransitionPreconditions();
128 $this->assertFalse($preconditions);
135 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
137 $node->addDetector($detector);
140 $detector->trigger(array());
141 $result = $node->attemptTransition();
151 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
153 $node->addDetector($detector);
156 $result = $node->attemptTransition();
168 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
170 $node->addDetector($detector);
174 $node->executeTransition();
175 $state = $node->isActive();
178 $this->assertFalse(
$state);
185 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
187 $node->addDetector($detector);
189 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
191 $activity->setLogFile(
'ilTransitionLog.txt');
192 $activity->setLogLevel(
'MESSAGE');
193 $activity->setLogMessage(
'TEST');
194 $node->addActivity($activity);
198 $node->executeTransition();
201 $expected =
' :: MESSAGE :: TEST';
202 $fp =
fopen(
'ilTransitionLog.txt',
'r');
204 $actual = substr($line, 25, strlen($line) - 27);
205 @unlink(
'ilTransitionLog.txt');
216 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
218 $node->addDetector($detector);
220 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilActivationEmitter.php';
223 $t_node->addDetector($t_detector);
225 $t_node->addDetector($foo_detector);
229 $emitter->setTargetDetector($t_detector);
230 $node->addEmitter($emitter);
234 $node->executeTransition();
237 $this->assertTrue($t_node->isActive());
244 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
248 $node->addDetector($detector);
249 $detectors = $node->getDetectors();
252 $this->assertEquals($detector, $detectors[0]);
259 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilSimpleEmitter.php';
263 $node->addEmitter($emitter);
264 $emitters = $node->getEmitters();
267 $this->assertEquals($emitter, $emitters[0]);
274 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
278 $node->addActivity($activity);
279 $activities = $node->getActivities();
282 $this->assertEquals($activity, $activities[0]);
290 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
292 $node->addDetector($detector);
297 $detector->setDetectorState(
true);
306 $node->notifyDetectorSatisfaction($detector);
309 $this->assertFalse($node->isActive());
316 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
318 $node->addDetector($detector);
324 $this->assertFalse($node->isForwardConditionNode(),
'Forward condition should be false by default.');
325 $node->setIsForwardConditionNode(
true);
326 $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()
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
testCheckTransitionPreconditionsInvalid()
testSetGetIsForwardConditionNode()
testIsActiveAndActivate()
testNotifyDetectorSatisfaction()
testAttemptTransitionValid()