ilSettingActivityTest is part of the petri net based workflow engine.
More...
ilSettingActivityTest is part of the petri net based workflow engine.
This class holds all tests for the class activities/class.ilSettingActivity
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 16 of file ilSettingActivityTest.php.
◆ setUp()
ilSettingActivityTest::setUp |
( |
| ) |
|
Reimplemented from ilWorkflowEngineBaseTest.
Definition at line 18 of file ilSettingActivityTest.php.
18 : void
19 {
20 parent::setUp();
21
22 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
23
24
25
26 require_once './Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
28
29
30 require_once './Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
32
33
34 $this->workflow->addNode($this->node);
35
36 require_once './Services/WorkflowEngine/classes/activities/class.ilSettingActivity.php';
37 }
@noinspection PhpIncludeInspection
@noinspection PhpIncludeInspection
◆ tearDown()
ilSettingActivityTest::tearDown |
( |
| ) |
|
Definition at line 39 of file ilSettingActivityTest.php.
39 : void
40 {
42
43 if (isset(
$DIC[
'ilSetting'])) {
44 $DIC[
'ilSetting']->delete(
'IL_PHPUNIT_TEST_TIME');
45 $DIC[
'ilSetting']->delete(
'IL_PHPUNIT_TEST_MICROTIME');
46 }
47 }
References $DIC.
◆ testConstructorValidContext()
ilSettingActivityTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 49 of file ilSettingActivityTest.php.
50 {
51
53
54
55
56 $this->assertTrue(
57 true,
58 'Construction failed with valid context passed to constructor.'
59 );
60 }
@noinspection PhpIncludeInspection
◆ testExecute()
ilSettingActivityTest::testExecute |
( |
| ) |
|
Definition at line 109 of file ilSettingActivityTest.php.
110 {
111
113 $expected_name = 'Ralle';
114 $expected_val = 'OK';
115 $activity->setSetting($expected_name, $expected_val);
116
117 $ilSetting_mock = $this->createMock('ilSetting', array('set'), array(), '', false);
118
119 $ilSetting_mock->expects($this->exactly(1))
120 ->method('set')
121 ->with($expected_name, $expected_val);
122
123 $stashed_real_object = '';
124 if (isset(
$GLOBALS[
'DIC'][
'ilSetting'])) {
125 $stashed_real_object =
$GLOBALS[
'DIC'][
'ilSetting'];
126 }
127
128 unset(
$GLOBALS[
'DIC'][
'ilSetting']);
129 $GLOBALS[
'DIC'][
'ilSetting'] = $ilSetting_mock;
130
131
132 $activity->execute();
133
134 $GLOBALS[
'DIC'][
'ilSetting'] = $stashed_real_object;
135 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
References $GLOBALS.
◆ testGetContext()
ilSettingActivityTest::testGetContext |
( |
| ) |
|
Definition at line 137 of file ilSettingActivityTest.php.
138 {
139
141
142
143 $actual = $activity->getContext();
144
145
146 if ($actual === $this->node) {
147 $this->assertEquals($actual, $this->node);
148 } else {
149 $this->assertTrue(false, 'Context not identical.');
150 }
151 }
◆ testSetGetSettingName()
ilSettingActivityTest::testSetGetSettingName |
( |
| ) |
|
Definition at line 62 of file ilSettingActivityTest.php.
63 {
64
66
67
68 $expected = 'Günther';
69 $activity->setSettingName($expected);
70 $actual = $activity->getSettingName();
71
72
73 $this->assertEquals($actual, $expected);
74 }
◆ testSetGetSettingValue()
ilSettingActivityTest::testSetGetSettingValue |
( |
| ) |
|
Definition at line 76 of file ilSettingActivityTest.php.
77 {
78
80
81
82 $expected = 'Günther';
83 $activity->setSettingValue($expected);
84 $actual = $activity->getSettingValue();
85
86
87 $this->assertEquals($actual, $expected);
88 }
◆ testSetSetting()
ilSettingActivityTest::testSetSetting |
( |
| ) |
|
Definition at line 90 of file ilSettingActivityTest.php.
91 {
92
94
95
96 $expected_name = 'Ralle';
97 $expected_value = 'OK';
98 $activity->setSetting($expected_name, $expected_value);
99 $actual_name = $activity->getSettingName();
100 $actual_value = $activity->getSettingValue();
101
102
103 $this->assertEquals(
104 $actual_name . $actual_value,
105 $expected_name . $expected_value
106 );
107 }
The documentation for this class was generated from the following file: