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.
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 |
( |
| ) |
|
◆ testConstructorValidContext()
ilSettingActivityTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 48 of file ilSettingActivityTest.php.
49 {
50
52
53
54
55 $this->assertTrue(
56 true,
57 'Construction failed with valid context passed to constructor.'
58 );
59 }
@noinspection PhpIncludeInspection
◆ testExecute()
ilSettingActivityTest::testExecute |
( |
| ) |
|
Definition at line 108 of file ilSettingActivityTest.php.
109 {
110
112 $expected_name = 'Ralle';
113 $expected_val = 'OK';
114 $activity->setSetting($expected_name, $expected_val);
115
116 require_once './Services/Administration/classes/class.ilSetting.php';
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 $stashed_real_object = @
$GLOBALS[
'ilSetting'];
123 $GLOBALS[
'ilSetting'] = $ilSetting_mock;
124
125
126 $activity->execute();
127
128 $GLOBALS[
'ilSetting'] = $stashed_real_object;
129 }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
References $GLOBALS.
◆ testGetContext()
ilSettingActivityTest::testGetContext |
( |
| ) |
|
Definition at line 131 of file ilSettingActivityTest.php.
132 {
133
135
136
137 $actual = $activity->getContext();
138
139
140 if ($actual === $this->node) {
141 $this->assertEquals($actual, $this->node);
142 } else {
143 $this->assertTrue(false, 'Context not identical.');
144 }
145 }
◆ testSetGetSettingName()
ilSettingActivityTest::testSetGetSettingName |
( |
| ) |
|
Definition at line 61 of file ilSettingActivityTest.php.
62 {
63
65
66
67 $expected = 'Günther';
68 $activity->setSettingName($expected);
69 $actual = $activity->getSettingName();
70
71
72 $this->assertEquals($actual, $expected);
73 }
◆ testSetGetSettingValue()
ilSettingActivityTest::testSetGetSettingValue |
( |
| ) |
|
Definition at line 75 of file ilSettingActivityTest.php.
76 {
77
79
80
81 $expected = 'Günther';
82 $activity->setSettingValue($expected);
83 $actual = $activity->getSettingValue();
84
85
86 $this->assertEquals($actual, $expected);
87 }
◆ testSetSetting()
ilSettingActivityTest::testSetSetting |
( |
| ) |
|
Definition at line 89 of file ilSettingActivityTest.php.
90 {
91
93
94
95 $expected_name = 'Ralle';
96 $expected_value = 'OK';
97 $activity->setSetting($expected_name, $expected_value);
98 $actual_name = $activity->getSettingName();
99 $actual_value = $activity->getSettingValue();
100
101
102 $this->assertEquals(
103 $actual_name . $actual_value,
104 $expected_name . $expected_value
105 );
106 }
The documentation for this class was generated from the following file: