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 14 of file ilSettingActivityTest.php.
◆ setUp()
ilSettingActivityTest::setUp |
( |
| ) |
|
Definition at line 16 of file ilSettingActivityTest.php.
17 {
18 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
19
20
21
22 require_once './Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
24
25
26 require_once './Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
28
29
30 $this->workflow->addNode($this->node);
31
32 require_once './Services/WorkflowEngine/classes/activities/class.ilSettingActivity.php';
33 }
@noinspection PhpIncludeInspection
@noinspection PhpIncludeInspection
◆ tearDown()
ilSettingActivityTest::tearDown |
( |
| ) |
|
◆ testConstructorValidContext()
ilSettingActivityTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 45 of file ilSettingActivityTest.php.
46 {
47
49
50
51
52 $this->assertTrue(
53 true,
54 'Construction failed with valid context passed to constructor.'
55 );
56 }
@noinspection PhpIncludeInspection
◆ testExecute()
ilSettingActivityTest::testExecute |
( |
| ) |
|
Definition at line 105 of file ilSettingActivityTest.php.
106 {
107
109 $expected_name = 'Ralle';
110 $expected_val = 'OK';
111 $activity->setSetting($expected_name, $expected_val);
112
113 require_once './Services/Administration/classes/class.ilSetting.php';
114 $ilSetting_mock = $this->getMock('ilSetting',array('set'),array(),'', FALSE);
115
116 $ilSetting_mock->expects($this->exactly(1))
117 ->method('set')
118 ->with($expected_name, $expected_val);
119 $stashed_real_object = @
$GLOBALS[
'ilSetting'];
120 $GLOBALS[
'ilSetting'] = $ilSetting_mock;
121
122
123 $activity->execute();
124
125 $GLOBALS[
'ilSetting'] = $stashed_real_object;
126
127 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
References $GLOBALS.
◆ testGetContext()
ilSettingActivityTest::testGetContext |
( |
| ) |
|
Definition at line 129 of file ilSettingActivityTest.php.
130 {
131
133
134
135 $actual = $activity->getContext();
136
137
138 if ($actual === $this->node)
139 {
140 $this->assertEquals($actual, $this->node);
141 } else {
142 $this->assertTrue(false, 'Context not identical.');
143 }
144 }
◆ testSetGetSettingName()
ilSettingActivityTest::testSetGetSettingName |
( |
| ) |
|
Definition at line 58 of file ilSettingActivityTest.php.
59 {
60
62
63
64 $expected = 'Günther';
65 $activity->setSettingName($expected);
66 $actual = $activity->getSettingName();
67
68
69 $this->assertEquals($actual, $expected);
70 }
◆ testSetGetSettingValue()
ilSettingActivityTest::testSetGetSettingValue |
( |
| ) |
|
Definition at line 72 of file ilSettingActivityTest.php.
73 {
74
76
77
78 $expected = 'Günther';
79 $activity->setSettingValue($expected);
80 $actual = $activity->getSettingValue();
81
82
83 $this->assertEquals($actual, $expected);
84 }
◆ testSetSetting()
ilSettingActivityTest::testSetSetting |
( |
| ) |
|
Definition at line 86 of file ilSettingActivityTest.php.
87 {
88
90
91
92 $expected_name = 'Ralle';
93 $expected_value = 'OK';
94 $activity->setSetting($expected_name, $expected_value);
95 $actual_name = $activity->getSettingName();
96 $actual_value = $activity->getSettingValue();
97
98
99 $this->assertEquals(
100 $actual_name.$actual_value,
101 $expected_name.$expected_value
102 );
103 }
The documentation for this class was generated from the following file: