ILIAS  release_8 Revision v8.24
ilObjTestGUITest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
26{
28
29 protected function setUp(): void
30 {
31 parent::setUp();
32
33 $this->markTestSkipped("DB causing issues");
34
35 $this->addGlobal_lng();
36 $this->addGlobal_ilCtrl();
37 $this->addGlobal_ilDB();
39 $this->addGlobal_tree();
40 $this->addGlobal_http();
41 $this->addGlobal_ilLocator();
42 $this->addGlobal_ilUser();
43 $this->addGlobal_ilAccess();
44 $this->addGlobal_ilSetting();
45 $this->addGlobal_rbacreview();
46 $this->addGlobal_ilToolbar();
47 $this->addGlobal_rbacsystem();
48 $this->addGlobal_filesystem();
49 $this->addGlobal_upload();
51 $this->addGlobal_tpl();
52 $this->addGlobal_ilErr();
53 $this->addGlobal_ilTabs();
54 $this->addGlobal_ilias();
55
56 $this->testObj = new ilObjTestGUI();
57 }
58
60 {
61 $this->assertInstanceOf(ilObjTestGUI::class, $this->testObj);
62 }
63
64 public function testTestAccess(): void
65 {
66 $this->assertNull($this->testObj->getTestAccess());
67 $testAccess_mock = $this->createMock(ilTestAccess::class);
68
69 $this->testObj->setTestAccess($testAccess_mock);
70 $this->assertEquals($testAccess_mock, $this->testObj->getTestAccess());
71 }
72
73 public function testGetTabsManager(): void
74 {
75 $this->assertNull($this->testObj->getTabsManager());
76 $testTabsManager_mock = $this->createMock(ilTestTabsManager::class);
77
78 $this->testObj->setTabsManager($testTabsManager_mock);
79 $this->assertEquals($testTabsManager_mock, $this->testObj->getTabsManager());
80 }
81
82 public function testRunObject(): void
83 {
84 $ctrl_mock = $this->createMock(ilCtrl::class);
85 $ctrl_mock
86 ->expects($this->once())
87 ->method("redirect")
88 ->with($this->testObj, "infoScreen");
89 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
90
91 $testObj = new ilObjTestGUI();
92
94 }
95
96 public function testOutEvaluationObject(): void
97 {
98 $ctrl_mock = $this->createMock(ilCtrl::class);
99 $ctrl_mock
100 ->expects($this->once())
101 ->method("redirectByClass")
102 ->with("iltestevaluationgui", "outEvaluation");
103 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
104
105 $testObj = new ilObjTestGUI();
106
108 }
109
110 public function testBackObject(): void
111 {
112 $ctrl_mock = $this->createMock(ilCtrl::class);
113 $ctrl_mock
114 ->expects($this->once())
115 ->method("redirect")
116 ->with($this->testObj, "questions");
117 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
118
119 $testObj = new ilObjTestGUI();
120
122 }
123
124 public function testCancelRandomSelectObject(): void
125 {
126 $ctrl_mock = $this->createMock(ilCtrl::class);
127 $ctrl_mock
128 ->expects($this->once())
129 ->method("redirect")
130 ->with($this->testObj, "questions");
131 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
132
133 $testObj = new ilObjTestGUI();
134
136 }
137
138 public function testCancelCreateQuestionObject(): void
139 {
140 $ctrl_mock = $this->createMock(ilCtrl::class);
141 $ctrl_mock
142 ->expects($this->once())
143 ->method("redirect")
144 ->with($this->testObj, "questions");
145 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
146
147 $testObj = new ilObjTestGUI();
148
150 }
151
152 public function testCancelRemoveQuestionsObject(): void
153 {
154 $ctrl_mock = $this->createMock(ilCtrl::class);
155 $ctrl_mock
156 ->expects($this->once())
157 ->method("redirect")
158 ->with($this->testObj, "questions");
159 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
160
161 $testObj = new ilObjTestGUI();
162
164 }
165
166 public function testMoveQuestionsObject(): void
167 {
168 $_POST['q_id'] = 1;
169
170 $ctrl_mock = $this->createMock(ilCtrl::class);
171 $ctrl_mock
172 ->expects($this->once())
173 ->method("redirect")
174 ->with($this->testObj, "questions");
175 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
176
177 $testObj = new ilObjTestGUI();
178
180 }
181}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_instantiateObject_shouldReturnInstance()
ilObjTestGUI $testObj
Class ilObjTestGUI.
backObject()
Called when the back button in the question browser was pressed.
cancelRemoveQuestionsObject()
Cancels the removal of questions from the test.
moveQuestionsObject()
Marks selected questions for moving.
cancelCreateQuestionObject()
Called when the creation of a new question is cancelled.
Class ilTestBaseClass.
setGlobalVariable(string $name, $value)