ilCaseNodeTest is part of the petri net based workflow engine.
More...
ilCaseNodeTest is part of the petri net based workflow engine.
This class holds all tests for the class nodes/class.ilCaseNode
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 15 of file ilCaseNodeTest.php.
◆ setUp()
ilCaseNodeTest::setUp |
( |
| ) |
|
Definition at line 20 of file ilCaseNodeTest.php.
22 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
26 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
◆ tearDown()
ilCaseNodeTest::tearDown |
( |
| ) |
|
Definition at line 30 of file ilCaseNodeTest.php.
References $ilSetting.
33 if ($ilSetting != null) {
34 $ilSetting->delete(
'IL_PHPUNIT_TEST_TIME');
35 $ilSetting->delete(
'IL_PHPUNIT_TEST_MICROTIME');
◆ testAddDetectorFirst()
ilCaseNodeTest::testAddDetectorFirst |
( |
| ) |
|
Definition at line 324 of file ilCaseNodeTest.php.
328 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
332 $node->addDetector($detector);
333 $detectors = $node->getDetectors();
336 $this->assertEquals($detector, $detectors[0]);
◆ testAddGetActivity()
ilCaseNodeTest::testAddGetActivity |
( |
| ) |
|
Definition at line 339 of file ilCaseNodeTest.php.
343 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
347 $node->addActivity($activity);
348 $activities = $node->getActivities();
351 $this->assertEquals($activity, $activities[0]);
◆ testAttemptTransitionPreconditionsValidOnExclusiveJoin()
ilCaseNodeTest::testAttemptTransitionPreconditionsValidOnExclusiveJoin |
( |
| ) |
|
Definition at line 181 of file ilCaseNodeTest.php.
References $success.
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();
◆ testCheckTransitionPreconditionsInvalid()
ilCaseNodeTest::testCheckTransitionPreconditionsInvalid |
( |
| ) |
|
Definition at line 161 of file ilCaseNodeTest.php.
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);
◆ testCheckTransitionPreconditionsValid()
ilCaseNodeTest::testCheckTransitionPreconditionsValid |
( |
| ) |
|
Definition at line 102 of file ilCaseNodeTest.php.
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);
◆ testCheckTransitionPreconditionsValidOnExclusiveJoin()
ilCaseNodeTest::testCheckTransitionPreconditionsValidOnExclusiveJoin |
( |
| ) |
|
Definition at line 122 of file ilCaseNodeTest.php.
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);
◆ testConstructorValidContext()
ilCaseNodeTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 39 of file ilCaseNodeTest.php.
48 'Construction failed with valid context passed to constructor.'
◆ testDeactivate()
ilCaseNodeTest::testDeactivate |
( |
| ) |
|
Definition at line 84 of file ilCaseNodeTest.php.
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);
◆ testExecuteActivitiesViaExecuteTransition()
ilCaseNodeTest::testExecuteActivitiesViaExecuteTransition |
( |
| ) |
|
Definition at line 236 of file ilCaseNodeTest.php.
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');
◆ testExecuteEmitterViaExecuteTransition()
ilCaseNodeTest::testExecuteEmitterViaExecuteTransition |
( |
| ) |
|
Definition at line 267 of file ilCaseNodeTest.php.
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());
◆ testExecuteEmitterViaExecuteTransitionExclusiveFork()
ilCaseNodeTest::testExecuteEmitterViaExecuteTransitionExclusiveFork |
( |
| ) |
|
Definition at line 295 of file ilCaseNodeTest.php.
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());
◆ testExecuteTransition()
ilCaseNodeTest::testExecuteTransition |
( |
| ) |
|
Definition at line 201 of file ilCaseNodeTest.php.
References $state.
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);
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
◆ testExecuteTransitionExclusiveFork()
ilCaseNodeTest::testExecuteTransitionExclusiveFork |
( |
| ) |
|
Definition at line 218 of file ilCaseNodeTest.php.
References $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);
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
◆ testGetContext()
ilCaseNodeTest::testGetContext |
( |
| ) |
|
Definition at line 52 of file ilCaseNodeTest.php.
58 $actual = $node->getContext();
61 if ($actual === $this->workflow) {
62 $this->assertEquals($actual, $this->workflow);
64 $this->assertTrue(
false,
'Context not identical.');
◆ testIsActiveAndActivate()
ilCaseNodeTest::testIsActiveAndActivate |
( |
| ) |
|
Definition at line 68 of file ilCaseNodeTest.php.
72 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
74 $node->addDetector($detector);
80 $actual = $node->isActive();
81 $this->assertTrue($actual);
◆ testNotifyDetectorSatisfactionAndTransit()
ilCaseNodeTest::testNotifyDetectorSatisfactionAndTransit |
( |
| ) |
|
Definition at line 142 of file ilCaseNodeTest.php.
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());
◆ $workflow
ilCaseNodeTest::$workflow |
The documentation for this class was generated from the following file: