ilCounterDetectorTest is part of the petri net based workflow engine.
More...
ilCounterDetectorTest is part of the petri net based workflow engine.
This class holds all tests for the class detectors/class.ilCounterDetector
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 15 of file ilCounterDetectorTest.php.
◆ setUp()
ilCounterDetectorTest::setUp |
( |
| ) |
|
Definition at line 17 of file ilCounterDetectorTest.php.
19 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
23 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
27 require_once
'./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
31 $this->workflow->addNode($this->node);
33 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilCounterDetector.php';
◆ tearDown()
ilCounterDetectorTest::tearDown |
( |
| ) |
|
Definition at line 36 of file ilCounterDetectorTest.php.
References $ilSetting.
39 if ($ilSetting != null) {
40 $ilSetting->delete(
'IL_PHPUNIT_TEST_TIME');
41 $ilSetting->delete(
'IL_PHPUNIT_TEST_MICROTIME');
◆ testConstructorValidContext()
ilCounterDetectorTest::testConstructorValidContext |
( |
| ) |
|
◆ testGetContext()
ilCounterDetectorTest::testGetContext |
( |
| ) |
|
Definition at line 155 of file ilCounterDetectorTest.php.
161 $actual = $detector->getContext();
164 if ($actual === $this->node) {
165 $this->assertEquals($actual, $this->node);
167 $this->assertTrue(
false,
'Context not identical.');
◆ testSetGetActualTriggerEvents()
ilCounterDetectorTest::testSetGetActualTriggerEvents |
( |
| ) |
|
Definition at line 72 of file ilCounterDetectorTest.php.
79 $detector->setActualTriggerEvents($expected);
80 $actual = $detector->getActualTriggerEvents();
83 $this->assertEquals($actual, $expected);
◆ testSetGetExpectedTriggerEvents()
ilCounterDetectorTest::testSetGetExpectedTriggerEvents |
( |
| ) |
|
Definition at line 58 of file ilCounterDetectorTest.php.
65 $detector->setExpectedTriggerEvents($expected);
66 $actual = $detector->getExpectedTriggerEvents();
69 $this->assertEquals($actual, $expected);
◆ testTriggerOversatisfy()
ilCounterDetectorTest::testTriggerOversatisfy |
( |
| ) |
|
Definition at line 142 of file ilCounterDetectorTest.php.
147 $detector->setExpectedTriggerEvents($expected);
150 $this->assertTrue($detector->trigger(null));
151 $this->assertTrue($detector->trigger(null));
152 $this->assertFalse($detector->trigger(null));
◆ testTriggerSatisfy()
ilCounterDetectorTest::testTriggerSatisfy |
( |
| ) |
|
Definition at line 113 of file ilCounterDetectorTest.php.
118 $detector->setExpectedTriggerEvents($expected);
121 $detector->trigger(null);
122 $detector->trigger(null);
127 if ($detector->getActualTriggerEvents() != 2) {
128 $valid_state =
false;
131 if ($detector->getExpectedTriggerEvents() != $expected) {
132 $valid_state =
false;
135 if (!$detector->getDetectorState()) {
136 $valid_state =
false;
139 $this->assertTrue($valid_state,
'Detector state invalid.');
◆ testTriggerUnsatisfy()
ilCounterDetectorTest::testTriggerUnsatisfy |
( |
| ) |
|
Definition at line 86 of file ilCounterDetectorTest.php.
91 $detector->setExpectedTriggerEvents($expected);
94 $detector->trigger(null);
98 if ($detector->getActualTriggerEvents() != 1) {
102 if ($detector->getExpectedTriggerEvents() != $expected) {
103 $valid_state =
false;
106 if ($detector->getDetectorState()) {
107 $valid_state =
false;
110 $this->assertTrue($valid_state,
'Detector state invalid.');
The documentation for this class was generated from the following file: