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) {
31 $ilSetting->delete(
'IL_PHPUNIT_TEST_TIME');
32 $ilSetting->delete(
'IL_PHPUNIT_TEST_MICROTIME');
◆ testAddActivity()
ilBasicNodeTest::testAddActivity |
( |
| ) |
|
Definition at line 270 of file ilBasicNodeTest.php.
274 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
278 $node->addActivity($activity);
279 $activities = $node->getActivities();
282 $this->assertEquals($activity, $activities[0]);
◆ testAddDetector()
ilBasicNodeTest::testAddDetector |
( |
| ) |
|
Definition at line 240 of file ilBasicNodeTest.php.
244 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
248 $node->addDetector($detector);
249 $detectors = $node->getDetectors();
252 $this->assertEquals($detector, $detectors[0]);
◆ testAddEmitter()
ilBasicNodeTest::testAddEmitter |
( |
| ) |
|
Definition at line 255 of file ilBasicNodeTest.php.
259 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilSimpleEmitter.php';
263 $node->addEmitter($emitter);
264 $emitters = $node->getEmitters();
267 $this->assertEquals($emitter, $emitters[0]);
◆ testAttemptTransitionInvalid()
ilBasicNodeTest::testAttemptTransitionInvalid |
( |
| ) |
|
Definition at line 147 of file ilBasicNodeTest.php.
References $result.
151 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
153 $node->addDetector($detector);
156 $result = $node->attemptTransition();
◆ testAttemptTransitionValid()
ilBasicNodeTest::testAttemptTransitionValid |
( |
| ) |
|
Definition at line 131 of file ilBasicNodeTest.php.
References $result, and array.
135 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
137 $node->addDetector($detector);
140 $detector->trigger(
array());
141 $result = $node->attemptTransition();
Create styles array
The data for the language used.
◆ testCheckTransitionPreconditionsInvalid()
ilBasicNodeTest::testCheckTransitionPreconditionsInvalid |
( |
| ) |
|
Definition at line 115 of file ilBasicNodeTest.php.
119 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
121 $node->addDetector($detector);
125 $preconditions = $node->checkTransitionPreconditions();
128 $this->assertFalse($preconditions);
◆ testCheckTransitionPreconditionsValid()
ilBasicNodeTest::testCheckTransitionPreconditionsValid |
( |
| ) |
|
Definition at line 99 of file ilBasicNodeTest.php.
References array.
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);
Create styles array
The data for the language used.
◆ testConstructorValidContext()
ilBasicNodeTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 36 of file ilBasicNodeTest.php.
45 'Construction failed with valid context passed to constructor.'
◆ testDeactivate()
ilBasicNodeTest::testDeactivate |
( |
| ) |
|
Definition at line 81 of file ilBasicNodeTest.php.
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);
◆ testExecuteActivitiesViaExecuteTransition()
ilBasicNodeTest::testExecuteActivitiesViaExecuteTransition |
( |
| ) |
|
Definition at line 181 of file ilBasicNodeTest.php.
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');
◆ testExecuteEmitterViaExecuteTransition()
ilBasicNodeTest::testExecuteEmitterViaExecuteTransition |
( |
| ) |
|
Definition at line 212 of file ilBasicNodeTest.php.
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());
◆ testExecuteTransition()
ilBasicNodeTest::testExecuteTransition |
( |
| ) |
|
Definition at line 162 of file ilBasicNodeTest.php.
References $state.
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);
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
◆ testGetContext()
ilBasicNodeTest::testGetContext |
( |
| ) |
|
Definition at line 49 of file ilBasicNodeTest.php.
55 $actual = $node->getContext();
58 if ($actual === $this->workflow) {
59 $this->assertEquals($actual, $this->workflow);
61 $this->assertTrue(
false,
'Context not identical.');
◆ testIsActiveAndActivate()
ilBasicNodeTest::testIsActiveAndActivate |
( |
| ) |
|
Definition at line 65 of file ilBasicNodeTest.php.
69 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
71 $node->addDetector($detector);
77 $actual = $node->isActive();
78 $this->assertTrue($actual);
◆ testNotifyDetectorSatisfaction()
ilBasicNodeTest::testNotifyDetectorSatisfaction |
( |
| ) |
|
Definition at line 285 of file ilBasicNodeTest.php.
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());
◆ testSetGetIsForwardConditionNode()
ilBasicNodeTest::testSetGetIsForwardConditionNode |
( |
| ) |
|
Definition at line 312 of file ilBasicNodeTest.php.
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.');
The documentation for this class was generated from the following file: