22 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
26 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
33 if ($ilSetting != null) {
34 $ilSetting->delete(
'IL_PHPUNIT_TEST_TIME');
35 $ilSetting->delete(
'IL_PHPUNIT_TEST_MICROTIME');
48 'Construction failed with valid context passed to constructor.' 58 $actual = $node->getContext();
61 if ($actual === $this->workflow) {
62 $this->assertEquals($actual, $this->workflow);
64 $this->assertTrue(
false,
'Context not identical.');
72 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
74 $node->addDetector($detector);
80 $actual = $node->isActive();
81 $this->assertTrue($actual);
88 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
90 $node->addDetector($detector);
94 $was_activated = $node->isActive();
96 $was_deactivated = !$node->isActive();
99 $this->assertEquals($was_activated, $was_deactivated);
106 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
108 $node->addDetector($detector1);
110 $node->addDetector($detector2);
112 $detector1->trigger(null);
113 $detector2->trigger(null);
116 $preconditions = $node->checkTransitionPreconditions();
119 $this->assertTrue($preconditions);
126 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
128 $node->addDetector($detector1);
130 $node->addDetector($detector2);
131 $node->setIsExclusiveJoin(
true);
132 $detector1->trigger(null);
133 $detector2->trigger(null);
136 $preconditions = $node->checkTransitionPreconditions();
139 $this->assertTrue($preconditions);
146 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
148 $node->addDetector($detector1);
150 $node->addDetector($detector2);
154 $this->assertTrue($node->isActive());
155 $detector1->trigger(null);
156 $detector2->trigger(null);
158 $this->assertFalse($node->isActive());
165 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
167 $node->addDetector($detector1);
169 $node->addDetector($detector2);
171 $detector1->trigger(null);
175 $preconditions = $node->checkTransitionPreconditions();
178 $this->assertFalse($preconditions);
185 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
187 $node->addDetector($detector1);
189 $node->addDetector($detector2);
190 $node->setIsExclusiveJoin(
true);
191 $detector1->trigger(null);
192 $detector2->trigger(null);
195 $success = $node->attemptTransition();
205 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
207 $node->addDetector($detector);
211 $node->executeTransition();
212 $state = $node->isActive();
215 $this->assertFalse(
$state);
222 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
224 $node->addDetector($detector);
226 $node->setIsExclusiveFork(
true);
229 $node->executeTransition();
230 $state = $node->isActive();
233 $this->assertFalse(
$state);
240 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
242 $node->addDetector($detector);
244 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
246 $activity->setLogFile(
'ilTransitionLog.txt');
247 $activity->setLogLevel(
'MESSAGE');
248 $activity->setLogMessage(
'TEST');
249 $node->addActivity($activity);
253 $node->executeTransition();
256 $expected =
' :: MESSAGE :: TEST';
257 $fp = fopen(
'ilTransitionLog.txt', r);
259 $actual = substr($line, 25, strlen($line)-27);
260 @unlink(
'ilTransitionLog.txt');
271 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
273 $node->addDetector($detector);
275 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilActivationEmitter.php';
278 $t_node->addDetector($t_detector);
280 $t_node->addDetector($foo_detector);
284 $emitter->setTargetDetector($t_detector);
285 $node->addEmitter($emitter);
289 $node->executeTransition();
292 $this->assertTrue($t_node->isActive());
299 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
301 $node->addDetector($detector);
303 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilActivationEmitter.php';
306 $t_node->addDetector($t_detector);
308 $t_node->addDetector($foo_detector);
312 $emitter->setTargetDetector($t_detector);
313 $node->addEmitter($emitter);
314 $node->setIsExclusiveFork(
true);
318 $node->executeTransition();
321 $this->assertTrue($t_node->isActive());
328 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
332 $node->addDetector($detector);
333 $detectors = $node->getDetectors();
336 $this->assertEquals($detector, $detectors[0]);
343 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
347 $node->addActivity($activity);
348 $activities = $node->getActivities();
351 $this->assertEquals($activity, $activities[0]);
testConstructorValidContext()
testNotifyDetectorSatisfactionAndTransit()
testCheckTransitionPreconditionsValid()
testIsActiveAndActivate()
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
testCheckTransitionPreconditionsInvalid()
testExecuteActivitiesViaExecuteTransition()
ilCaseNodeTest is part of the petri net based workflow engine.
testAttemptTransitionPreconditionsValidOnExclusiveJoin()
testExecuteEmitterViaExecuteTransitionExclusiveFork()
testExecuteTransitionExclusiveFork()
testCheckTransitionPreconditionsValidOnExclusiveJoin()
testExecuteEmitterViaExecuteTransition()