ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestBaseTestCase Class Reference

Class ilTestBaseClass. More...

+ Inheritance diagram for ilTestBaseTestCase:
+ Collaboration diagram for ilTestBaseTestCase:

Protected Member Functions

 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 
 addGlobal_ilAccess ()
 
 addGlobal_ilUser ()
 
 addGlobal_objDefinition ()
 
 addGlobal_tree ()
 
 addGlobal_ilSetting ()
 
 addGlobal_rbacsystem ()
 
 addGlobal_ilRbacAdmin ()
 
 addGlobal_ilCtrl ()
 
 addGlobal_lng ()
 
 addGlobal_filesystem ()
 
 addGlobal_upload ()
 
 addGlobal_ilDB ()
 
 addGlobal_ilBench ()
 
 addGlobal_ilLog ()
 
 addGlobal_ilias ()
 
 addGlobal_ilErr ()
 
 addGlobal_GlobalScreenService ()
 
 addGlobal_ilNavigationHistory ()
 
 addGlobal_ilAppEventHandler ()
 
 addGlobal_tpl ()
 
 addGlobal_ilComponentRepository ()
 
 addGlobal_ilComponentFactory ()
 
 addGlobal_ilTabs ()
 
 addGlobal_ilObjDataCache ()
 
 addGlobal_ilLocator ()
 
 addGlobal_rbacreview ()
 
 addGlobal_ilToolbar ()
 
 addGlobal_http ()
 
 addGlobal_ilIliasIniFile ()
 
 addGlobal_ilLoggerFactory ()
 
 addGlobal_ilHelp ()
 
 addGlobal_ui ()
 
 addGlobal_uiFactory ()
 
 addGlobal_uiRenderer ()
 
 addGlobal_refinery ()
 
 addGlobal_skillService ()
 
 addGlobal_objectService ()
 
 addGlobal_resourceStorage ()
 
 getTestObjMock ()
 

Protected Attributes

Container $dic = null
 

Detailed Description

Class ilTestBaseClass.

Author
Marvin Beym mbeym.nosp@m.@dat.nosp@m.abay..nosp@m.de

Definition at line 36 of file ilTestBaseTestCase.php.

Member Function Documentation

◆ addGlobal_filesystem()

ilTestBaseTestCase::addGlobal_filesystem ( )
protected

Definition at line 190 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestTest\setUp(), and ilObjTestGUITest\setUp().

190  : void
191  {
192  $this->setGlobalVariable("filesystem", $this->createMock(Filesystems::class));
193  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_GlobalScreenService()

ilTestBaseTestCase::addGlobal_GlobalScreenService ( )
protected

Definition at line 225 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilTestScoringByQuestionsGUITest\setUp(), ilTestScoringGUITest\setUp(), ilTestPlayerFixedQuestionSetGUITest\setUp(), ilTestEvalObjectiveOrientedGUITest\setUp(), ilTestEvaluationGUITest\setUp(), ilTestPlayerRandomQuestionSetGUITest\setUp(), ilTestServiceGUITest\setUp(), ilTestSubmissionReviewGUITest\setUp(), and ilObjTestGUITest\setUp().

225  : void
226  {
227  $this->setGlobalVariable("global_screen", $this->createMock(ILIAS\GlobalScreen\Services::class));
228  }
Class ChatMainBarProvider .
setGlobalVariable(string $name, $value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_http()

ilTestBaseTestCase::addGlobal_http ( )
protected

Definition at line 280 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilParticipantsTestResultsGUITest\setUp(), ilTestResultsGUITest\setUp(), ilTestEvaluationGUITest\setUp(), ilTestCorrectionsGUITest\setUp(), and ilObjTestGUITest\setUp().

280  : void
281  {
282  $http_mock = $this->getMockBuilder(Services::class)->disableOriginalConstructor()->getMock();
283  $http_mock->method('request')->willReturn($this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->disableOriginalConstructor()->getMock());
284  $this->setGlobalVariable("http", $http_mock);
285  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilAccess()

◆ addGlobal_ilAppEventHandler()

ilTestBaseTestCase::addGlobal_ilAppEventHandler ( )
protected

Definition at line 235 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestSettingsMainGUITest\setUp(), ilTestTaxonomyTreeTest\setUp(), ilObjAssessmentFolderTest\setUp(), ilObjTestVerificationTest\setUp(), ilObjTestTest\setUp(), and setUp().

235  : void
236  {
237  $this->setGlobalVariable("ilAppEventHandler", $this->createMock(ilAppEventHandler::class));
238  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilBench()

ilTestBaseTestCase::addGlobal_ilBench ( )
protected

Definition at line 205 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestTest\setUp(), ilTestExportRandomQuestionSetTest\setUp(), ilTestExportFixedQuestionSetTest\setUp(), and ilTestExportFactoryTest\setUp().

205  : void
206  {
207  $this->setGlobalVariable("ilBench", $this->createMock(ilBenchmark::class));
208  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilComponentFactory()

ilTestBaseTestCase::addGlobal_ilComponentFactory ( )
protected

Definition at line 250 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilTestQuestionFilterLabelTranslaterTest\setUp(), ilObjTestTest\setUp(), ilObjTestGUITest\setUp(), ilTestVerificationTableGUITest\setUp(), and setUp().

250  : void
251  {
252  $this->setGlobalVariable("component.factory", $this->createMock(ilComponentFactory::class));
253  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilComponentRepository()

◆ addGlobal_ilCtrl()

◆ addGlobal_ilDB()

◆ addGlobal_ilErr()

ilTestBaseTestCase::addGlobal_ilErr ( )
protected

Definition at line 220 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestSettingsMainGUITest\setUp(), ilTestExportRandomQuestionSetTest\setUp(), ilObjTestTest\setUp(), ilTestEvaluationGUITest\setUp(), ilTestExportFixedQuestionSetTest\setUp(), ilObjTestVerificationTest\setUp(), ilObjAssessmentFolderTest\setUp(), ilObjTestGUITest\setUp(), and setUp().

220  : void
221  {
222  $this->setGlobalVariable("ilErr", $this->createMock(ilErrorHandling::class));
223  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilHelp()

ilTestBaseTestCase::addGlobal_ilHelp ( )
protected

◆ addGlobal_ilias()

◆ addGlobal_ilIliasIniFile()

ilTestBaseTestCase::addGlobal_ilIliasIniFile ( )
protected

Definition at line 287 of file ilTestBaseTestCase.php.

References setGlobalVariable().

287  : void
288  {
289  $this->setGlobalVariable("ilIliasIniFile", $this->createMock(ilIniFile::class));
290  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilLocator()

ilTestBaseTestCase::addGlobal_ilLocator ( )
protected

Definition at line 265 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

265  : void
266  {
267  $this->setGlobalVariable("ilLocator", $this->createMock(ilLocatorGUI::class));
268  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilLog()

◆ addGlobal_ilLoggerFactory()

ilTestBaseTestCase::addGlobal_ilLoggerFactory ( )
protected

Definition at line 292 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilParticipantsTestResultsGUITest\setUp(), ilTestResultsGUITest\setUp(), and ilTestEvaluationGUITest\setUp().

292  : void
293  {
294  $this->setGlobalVariable("ilLoggerFactory", $this->createMock(ilLoggerFactory::class));
295  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilNavigationHistory()

ilTestBaseTestCase::addGlobal_ilNavigationHistory ( )
protected

Definition at line 230 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilTestScoringByQuestionsGUITest\setUp(), ilTestScoringGUITest\setUp(), ilTestPlayerFixedQuestionSetGUITest\setUp(), ilTestEvalObjectiveOrientedGUITest\setUp(), ilTestEvaluationGUITest\setUp(), ilTestPlayerRandomQuestionSetGUITest\setUp(), ilTestServiceGUITest\setUp(), ilTestSubmissionReviewGUITest\setUp(), and ilObjTestGUITest\setUp().

230  : void
231  {
232  $this->setGlobalVariable("ilNavigationHistory", $this->createMock(ilNavigationHistory::class));
233  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilObjDataCache()

ilTestBaseTestCase::addGlobal_ilObjDataCache ( )
protected

◆ addGlobal_ilRbacAdmin()

ilTestBaseTestCase::addGlobal_ilRbacAdmin ( )
protected

Definition at line 175 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

175  : void
176  {
177  $this->setGlobalVariable("rbacadmin", $this->createMock(ilRbacAdmin::class));
178  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilSetting()

ilTestBaseTestCase::addGlobal_ilSetting ( )
protected

Definition at line 165 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilTestScoringByQuestionsGUITest\setUp(), ilTestScoringGUITest\setUp(), ilTestServiceGUITest\setUp(), ilTestSubmissionReviewGUITest\setUp(), ilTestEvalObjectiveOrientedGUITest\setUp(), ilTestPlayerRandomQuestionSetGUITest\setUp(), ilTestPlayerFixedQuestionSetGUITest\setUp(), ilTestEvaluationGUITest\setUp(), ilObjTestTest\setUp(), and ilObjTestGUITest\setUp().

165  : void
166  {
167  $this->setGlobalVariable("ilSetting", $this->createMock(ilSetting::class));
168  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilTabs()

◆ addGlobal_ilToolbar()

◆ addGlobal_ilUser()

◆ addGlobal_lng()

ilTestBaseTestCase::addGlobal_lng ( )
protected

Definition at line 185 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilTestScoringByQuestionsGUITest\setUp(), ilTestScoringGUITest\setUp(), ilTestTopListTest\setUp(), ilTestQuestionFilterLabelTranslaterTest\setUp(), ilMarkSchemaGUITest\setUp(), ilTestDashboardGUITest\setUp(), ilTestParticipantsTimeExtensionGUITest\setUp(), ilTestParticipantListTest\setUp(), ilTestEvalObjectiveOrientedGUITest\setUp(), ilTestInfoScreenToolbarGUITest\setUp(), ilTestSubmissionReviewGUITest\setUp(), ilTestPlayerFixedQuestionSetGUITest\setUp(), ilObjTestTest\setUp(), ilParticipantsTestResultsGUITest\setUp(), ilTestResultsGUITest\setUp(), ilTestQuestionSetConfigFactoryTest\setUp(), ilTestPlayerRandomQuestionSetGUITest\setUp(), ilTestEvaluationGUITest\setUp(), ilTestExportFixedQuestionSetTest\setUp(), ilRandomTestROInputGUITest\setUp(), ilTestExportRandomQuestionSetTest\setUp(), ilTestServiceGUITest\setUp(), ilTestToplistGUITest\setUp(), ilTestNavigationToolbarGUITest\setUp(), ilTestQuestionsTableGUITest\setUp(), ilTestParticipantsTableGUITest\setUp(), ilTestRandomQuestionSetSourcePoolDefinitionListTableGUITest\setUp(), ilParticipantsTestResultsTableGUITest\setUp(), ilTestVerificationTableGUITest\setUp(), ilObjTestGUITest\setUp(), ilCronFinishUnfinishedTestPassesTest\setUp(), ilTestParticipantsGUITest\setUp(), ilTestTabsManagerTest\setUp(), ilTestFixedQuestionSetConfigTest\setUp(), setUp(), and ilTestPlayerConfirmationModalTest\testAddParameter().

185  : void
186  {
187  $this->setGlobalVariable("lng", $this->createMock(ilLanguage::class));
188  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_objDefinition()

ilTestBaseTestCase::addGlobal_objDefinition ( )
protected

Definition at line 155 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestSettingsMainGUITest\setUp(), ilTestRandomQuestionSetConfigGUITest\setUp(), ilObjTestTest\setUp(), ilObjTestVerificationTest\setUp(), ilObjAssessmentFolderTest\setUp(), ilObjTestGUITest\setUp(), and setUp().

155  : void
156  {
157  $this->setGlobalVariable("objDefinition", $this->createMock(ilObjectDefinition::class));
158  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_objectService()

ilTestBaseTestCase::addGlobal_objectService ( )
protected

Definition at line 329 of file ilTestBaseTestCase.php.

References $DIC, and setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

329  : void
330  {
331  global $DIC;
332  $DIC['object.customicons.factory'] = $this->getMockBuilder(ilObjectCustomIconFactory::class)->disableOriginalConstructor()->getMock();
333  $object_mock = $this->getMockBuilder(\ilObjectService::class)->disableOriginalConstructor()->getMock();
334 
335  $this->setGlobalVariable("object", $object_mock);
336  }
global $DIC
Definition: feed.php:28
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_rbacreview()

ilTestBaseTestCase::addGlobal_rbacreview ( )
protected

Definition at line 270 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

270  : void
271  {
272  $this->setGlobalVariable("rbacreview", $this->createMock(ilRbacReview::class));
273  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_rbacsystem()

ilTestBaseTestCase::addGlobal_rbacsystem ( )
protected

Definition at line 170 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilTestScoringByQuestionsGUITest\setUp(), ilTestScoringGUITest\setUp(), ilTestServiceGUITest\setUp(), ilTestSubmissionReviewGUITest\setUp(), ilTestEvalObjectiveOrientedGUITest\setUp(), ilTestPlayerRandomQuestionSetGUITest\setUp(), ilTestPlayerFixedQuestionSetGUITest\setUp(), ilTestEvaluationGUITest\setUp(), ilObjTestAccessTest\setUp(), and ilObjTestGUITest\setUp().

170  : void
171  {
172  $this->setGlobalVariable("rbacsystem", $this->createMock(ilRbacSystem::class));
173  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_refinery()

ilTestBaseTestCase::addGlobal_refinery ( )
protected

Definition at line 317 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilParticipantsTestResultsGUITest\setUp(), ilTestPlayerRandomQuestionSetGUITest\setUp(), ilTestPlayerFixedQuestionSetGUITest\setUp(), ilTestCorrectionsGUITest\setUp(), and setUp().

317  : void
318  {
319  $refineryMock = $this->getMockBuilder(RefineryFactory::class)->disableOriginalConstructor()->getMock();
320  $refineryMock->expects(self::any())->method('random')->willReturn($this->getMockBuilder(RandomGroup::class)->getMock());
321  $this->setGlobalVariable("refinery", $refineryMock);
322  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_resourceStorage()

ilTestBaseTestCase::addGlobal_resourceStorage ( )
protected

Definition at line 338 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by setUp().

338  : void
339  {
340  $this->setGlobalVariable("resource_storage", $this->createMock(ResourceStorage::class));
341  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_skillService()

ilTestBaseTestCase::addGlobal_skillService ( )
protected

Definition at line 324 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

324  : void
325  {
326  $this->setGlobalVariable("skill", $this->createMock(ILIAS\Skill\Service\SkillService::class));
327  }
Class ChatMainBarProvider .
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_tpl()

◆ addGlobal_tree()

◆ addGlobal_ui()

ilTestBaseTestCase::addGlobal_ui ( )
protected

Definition at line 302 of file ilTestBaseTestCase.php.

References setGlobalVariable().

302  : void
303  {
304  $this->setGlobalVariable("ui", $this->createMock(ILIAS\DI\UIServices::class));
305  }
Class ChatMainBarProvider .
Class HTTPServicesTest.
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_uiFactory()

◆ addGlobal_uiRenderer()

◆ addGlobal_upload()

ilTestBaseTestCase::addGlobal_upload ( )
protected

Definition at line 195 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

195  : void
196  {
197  $this->setGlobalVariable("upload", $this->createMock(FileUpload::class));
198  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDatabaseMock()

ilTestBaseTestCase::getDatabaseMock ( )
protected
Returns
ilDBInterface|mixed|MockObject

Definition at line 124 of file ilTestBaseTestCase.php.

125  {
126  return $this->getMockBuilder(ilDBInterface::class)->disableOriginalConstructor()->getMock();
127  }

◆ getGlobalTemplateMock()

ilTestBaseTestCase::getGlobalTemplateMock ( )
protected
Returns
ilTemplate|mixed|MockObject

Definition at line 116 of file ilTestBaseTestCase.php.

117  {
118  return $this->getMockBuilder(ilTemplate::class)->disableOriginalConstructor()->getMock();
119  }

◆ getIliasMock()

ilTestBaseTestCase::getIliasMock ( )
protected
Returns
ILIAS|mixed|MockObject

Definition at line 132 of file ilTestBaseTestCase.php.

Referenced by addGlobal_ilias().

133  {
134  $mock = $this->getMockBuilder(ILIAS::class)->disableOriginalConstructor()->getMock();
135 
136  $account = new stdClass();
137  $account->id = 6;
138  $account->fullname = 'Esther Tester';
139 
140  $mock->account = $account;
141 
142  return $mock;
143  }
+ Here is the caller graph for this function:

◆ getTestObjMock()

ilTestBaseTestCase::getTestObjMock ( )
protected

Definition at line 343 of file ilTestBaseTestCase.php.

References ilTestDIC\dic().

Referenced by ilTestScoringByQuestionsGUITest\setUp(), ilTestScoringGUITest\setUp(), ilTestServiceGUITest\setUp(), ilTestPlayerFixedQuestionSetGUITest\setUp(), ilTestEvaluationGUITest\setUp(), ilTestPlayerRandomQuestionSetGUITest\setUp(), ilTestSubmissionReviewGUITest\setUp(), and ilTestEvalObjectiveOrientedGUITest\setUp().

343  : ilObjTest
344  {
345  $test_mock = $this->createMock(ilObjTest::class);
346  $test_mock->method('getLocalDIC')
347  ->willReturn(
349  );
350  return $test_mock;
351  }
static dic()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGlobalVariable()

ilTestBaseTestCase::setGlobalVariable ( string  $name,
  $value 
)
protected
Parameters
string$name
mixed$value

Definition at line 101 of file ilTestBaseTestCase.php.

References Vendor\Package\$c, $DIC, and $GLOBALS.

Referenced by addGlobal_filesystem(), addGlobal_GlobalScreenService(), addGlobal_http(), addGlobal_ilAccess(), addGlobal_ilAppEventHandler(), addGlobal_ilBench(), addGlobal_ilComponentFactory(), addGlobal_ilComponentRepository(), addGlobal_ilCtrl(), addGlobal_ilDB(), addGlobal_ilErr(), addGlobal_ilHelp(), addGlobal_ilias(), addGlobal_ilIliasIniFile(), addGlobal_ilLocator(), addGlobal_ilLog(), addGlobal_ilLoggerFactory(), addGlobal_ilNavigationHistory(), addGlobal_ilObjDataCache(), addGlobal_ilRbacAdmin(), addGlobal_ilSetting(), addGlobal_ilTabs(), addGlobal_ilToolbar(), addGlobal_ilUser(), addGlobal_lng(), addGlobal_objDefinition(), addGlobal_objectService(), addGlobal_rbacreview(), addGlobal_rbacsystem(), addGlobal_refinery(), addGlobal_resourceStorage(), addGlobal_skillService(), addGlobal_tpl(), addGlobal_tree(), addGlobal_ui(), addGlobal_uiFactory(), addGlobal_uiRenderer(), addGlobal_upload(), ilTestHistoryTableGUITest\setUp(), ilTestRandomQuestionSetSourcePoolDefinitionListToolbarGUITest\setUp(), ilTestResultsToolbarGUITest\setUp(), ilTestTaxonomyTreeTest\setUp(), ilTestSkillEvaluationToolbarGUITest\setUp(), ilTestDetailedEvaluationStatisticsTableGUITest\setUp(), ilListOfQuestionsTableGUITest\setUp(), ilTestTopListTableGUITest\setUp(), ilTestPassOverviewTableGUITest\setUp(), ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUITest\setUp(), ilTestParticipantsTableGUITest\setUp(), ilTestPassManualScoringOverviewTableGUITest\setUp(), ilTestPersonalDefaultSettingsTableGUITest\setUp(), ilTestExportTableGUITest\setUp(), ilTestQuestionsTableGUITest\setUp(), ilTimingOverviewTableGUITest\setUp(), ilResultsByQuestionTableGUITest\setUp(), ilEvaluationAllTableGUITest\setUp(), ilAssessmentFolderLogTableGUITest\setUp(), ilTestQuestionBrowserTableGUITest\setUp(), ilTestRandomQuestionSetNonAvailablePoolsTableGUITest\setUp(), ilTestRandomQuestionSetSourcePoolDefinitionListTableGUITest\setUp(), ilTestSkillLevelThresholdsTableGUITest\setUp(), ilTestAverageReachedPointsTableGUITest\setUp(), ilTestManScoringParticipantsTableGUITest\setUp(), ilParticipantsTestResultsTableGUITest\setUp(), ilAssessmentFolderLogAdministrationTableGUITest\setUp(), ilTestPassDetailsOverviewTableGUITest\setUp(), ilMarkSchemaTableGUITest\setUp(), ilTestAggregatedResultsTableGUITest\setUp(), ilTestVerificationTableGUITest\setUp(), ilTestTabsManagerTest\setUp(), ilTestRandomQuestionSetGeneralConfigFormGUITest\setUp(), ilTestRandomQuestionSetPoolDefinitionFormGUITest\setUp(), ilTestSettingsChangeConfirmationGUITest\setUp(), setUp(), ilObjTestGUITest\testBackObject(), ilObjTestGUITest\testCancelCreateQuestionObject(), ilObjTestGUITest\testCancelRemoveQuestionsObject(), ilCronFinishUnfinishedTestPassesTest\testGetDescription(), ilCronFinishUnfinishedTestPassesTest\testGetTitle(), ilObjTestGUITest\testOutEvaluationObject(), and ilObjTestGUITest\testRunObject().

101  : void
102  {
103  global $DIC;
104 
105  $GLOBALS[$name] = $value;
106 
107  unset($DIC[$name]);
108  $DIC[$name] = static function (Container $c) use ($value) {
109  return $value;
110  };
111  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
global $DIC
Definition: feed.php:28
$GLOBALS["DIC"]
Definition: wac.php:31
+ Here is the caller graph for this function:

◆ setUp()

ilTestBaseTestCase::setUp ( )
protected

Definition at line 43 of file ilTestBaseTestCase.php.

References $DIC, addGlobal_ilAppEventHandler(), addGlobal_ilComponentFactory(), addGlobal_ilDB(), addGlobal_ilErr(), addGlobal_ilias(), addGlobal_ilLog(), addGlobal_lng(), addGlobal_objDefinition(), addGlobal_refinery(), addGlobal_resourceStorage(), addGlobal_tpl(), addGlobal_tree(), addGlobal_uiFactory(), addGlobal_uiRenderer(), and setGlobalVariable().

43  : void
44  {
45  global $DIC;
46 
47  $this->dic = is_object($DIC) ? clone $DIC : $DIC;
48 
49  $DIC = new Container();
50 
51  $this->addGlobal_tpl();
52  $this->addGlobal_ilDB();
53  $this->addGlobal_ilias();
54  $this->addGlobal_ilLog();
55  $this->addGlobal_ilErr();
56  $this->addGlobal_tree();
57  $this->addGlobal_lng();
59  $this->addGlobal_objDefinition();
60  $this->addGlobal_refinery();
62  $this->addGlobal_uiFactory();
63  $this->addGlobal_uiRenderer();
65 
66  $this->getMockBuilder(\ILIAS\DI\LoggingServices::class)->disableOriginalConstructor()->getMock();
67 
68  $http_mock = $this
69  ->getMockBuilder(\ILIAS\HTTP\Services::class)
70  ->disableOriginalConstructor()
71  ->onlyMethods(['request', 'wrapper'])->getMock();
72 
73  $request_mock = $this
74  ->getMockBuilder(\GuzzleHttp\Psr7\ServerRequest::class)
75  ->disableOriginalConstructor()
76  ->onlyMethods(['getParsedBody'])->getMock();
77  $request_mock->method('getParsedBody')->willReturn(array());
78  $http_mock->method('request')->willReturn($request_mock);
79 
80  $wrapper_mock = $this->createMock(\ILIAS\HTTP\Wrapper\WrapperFactory::class);
81  $http_mock->method('wrapper')->willReturn($wrapper_mock);
82 
83  $this->setGlobalVariable('http', $http_mock);
84 
85  parent::setUp();
86  }
Class ChatMainBarProvider .
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
global $DIC
Definition: feed.php:28
Class HTTPServicesTest.
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ tearDown()

ilTestBaseTestCase::tearDown ( )
protected

Definition at line 88 of file ilTestBaseTestCase.php.

References $DIC, and $dic.

88  : void
89  {
90  global $DIC;
91 
92  $DIC = $this->dic;
93 
94  parent::tearDown();
95  }
global $DIC
Definition: feed.php:28

Field Documentation

◆ $dic

Container ilTestBaseTestCase::$dic = null
protected

Definition at line 38 of file ilTestBaseTestCase.php.

Referenced by ilObjTestGUITest\tearDown(), and tearDown().


The documentation for this class was generated from the following file: