ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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_ilCtrl ()
 
 addGlobal_lng ()
 
 addGlobal_filesystem ()
 
 addGlobal_upload ()
 
 addGlobal_ilDB ()
 
 addGlobal_ilLog ()
 
 addGlobal_ilias ()
 
 addGlobal_ilErr ()
 
 addGlobal_ilAppEventHandler ()
 
 addGlobal_tpl ()
 
 addGlobal_ilComponentRepository ()
 
 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 ()
 

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 35 of file ilTestBaseTestCase.php.

Member Function Documentation

◆ addGlobal_filesystem()

ilTestBaseTestCase::addGlobal_filesystem ( )
protected

Definition at line 180 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

180  : void
181  {
182  $this->setGlobalVariable("filesystem", $this->createMock(Filesystems::class));
183  }
setGlobalVariable(string $name, $value)
+ 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 250 of file ilTestBaseTestCase.php.

References setGlobalVariable().

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

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

◆ addGlobal_ilAccess()

ilTestBaseTestCase::addGlobal_ilAccess ( )
protected

Definition at line 140 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp(), ilTestAccessTest\setUp(), ilTestCorrectionsGUITest\setUp(), ilTestRandomQuestionSetSourcePoolDefinitionListTableGUITest\setUp(), ilTestQuestionsTableGUITest\setUp(), and ilTestTabsManagerTest\setUp().

140  : void
141  {
142  $this->setGlobalVariable("ilAccess", $this->createMock(ilAccess::class));
143  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilAppEventHandler()

ilTestBaseTestCase::addGlobal_ilAppEventHandler ( )
protected

Definition at line 210 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjAssessmentFolderTest\setUp(), ilTestTaxonomyTreeTest\setUp(), ilObjTestSettingsGeneralGUITest\setUp(), ilObjTestVerificationTest\setUp(), ilObjTestTest\setUp(), setUp(), ilTestExportFactoryTest\testGetExporter(), and ilTestPlayerFactoryTest\testGetPlayerGUI().

210  : void
211  {
212  $this->setGlobalVariable("ilAppEventHandler", $this->createMock(ilAppEventHandler::class));
213  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilComponentRepository()

ilTestBaseTestCase::addGlobal_ilComponentRepository ( )
protected

Definition at line 220 of file ilTestBaseTestCase.php.

References setGlobalVariable().

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

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

◆ addGlobal_ilCtrl()

◆ addGlobal_ilDB()

ilTestBaseTestCase::addGlobal_ilDB ( )
protected

Definition at line 190 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilCronFinishUnfinishedTestPassesTest\setUp(), ilTestTopListTest\setUp(), ilTestToplistGUITest\setUp(), ilObjAssessmentFolderTest\setUp(), ilObjTestSettingsGeneralGUITest\setUp(), ilTestExportDynamicQuestionSetTest\setUp(), ilTestServiceGUITest\setUp(), ilObjTestTest\setUp(), ilTestScoringByQuestionsGUITest\setUp(), ilTestPlayerRandomQuestionSetGUITest\setUp(), ilTestExportFixedQuestionSetTest\setUp(), ilTestExportRandomQuestionSetTest\setUp(), ilObjTestVerificationTest\setUp(), ilTestPlayerFixedQuestionSetGUITest\setUp(), ilParticipantsTestResultsGUITest\setUp(), ilObjTestGUITest\setUp(), ilTestEvaluationGUITest\setUp(), ilTestTaxonomyFilterLabelTranslaterTest\setUp(), ilTestSubmissionReviewGUITest\setUp(), ilTestCorrectionsGUITest\setUp(), ilTestScoringGUITest\setUp(), ilTestEvalObjectiveOrientedGUITest\setUp(), setUp(), ilObjTestDynamicQuestionSetConfigTest\testAreDepenciesBroken(), ilObjTestDynamicQuestionSetConfigTest\testGetDepenciesBrokenMessage(), ilObjTestDynamicQuestionSetConfigTest\testGetDepenciesInVulnerableStateMessage(), ilTestExportFactoryTest\testGetExporter(), ilTestPlayerFactoryTest\testGetPlayerGUI(), ilObjTestDynamicQuestionSetConfigTest\testGetSourceQuestionPoolSummaryString(), and ilTestSkillLevelThresholdXmlParserTest\testInitSkillLevelThresholdImportList().

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

◆ addGlobal_ilErr()

ilTestBaseTestCase::addGlobal_ilErr ( )
protected

◆ addGlobal_ilHelp()

ilTestBaseTestCase::addGlobal_ilHelp ( )
protected

Definition at line 265 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilTestCorrectionsGUITest\setUp().

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

◆ addGlobal_ilias()

◆ addGlobal_ilIliasIniFile()

ilTestBaseTestCase::addGlobal_ilIliasIniFile ( )
protected

Definition at line 255 of file ilTestBaseTestCase.php.

References setGlobalVariable().

255  : void
256  {
257  $this->setGlobalVariable("ilIliasIniFile", $this->createMock(ilIniFile::class));
258  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilLocator()

ilTestBaseTestCase::addGlobal_ilLocator ( )
protected

Definition at line 235 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

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

◆ addGlobal_ilLog()

ilTestBaseTestCase::addGlobal_ilLog ( )
protected

Definition at line 195 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjAssessmentFolderTest\setUp(), ilObjTestSettingsGeneralGUITest\setUp(), ilObjTestVerificationTest\setUp(), ilObjTestTest\setUp(), setUp(), ilTestExportFactoryTest\testGetExporter(), and ilTestPlayerFactoryTest\testGetPlayerGUI().

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

◆ addGlobal_ilLoggerFactory()

ilTestBaseTestCase::addGlobal_ilLoggerFactory ( )
protected

Definition at line 260 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilParticipantsTestResultsGUITest\setUp().

260  : void
261  {
262  $this->setGlobalVariable("ilLoggerFactory", $this->createMock(ilLoggerFactory::class));
263  }
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_ilSetting()

ilTestBaseTestCase::addGlobal_ilSetting ( )
protected

Definition at line 160 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

160  : void
161  {
162  $this->setGlobalVariable("ilSetting", $this->createMock(ilSetting::class));
163  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilTabs()

◆ addGlobal_ilToolbar()

ilTestBaseTestCase::addGlobal_ilToolbar ( )
protected

Definition at line 245 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilMarkSchemaGUITest\setUp(), ilParticipantsTestResultsGUITest\setUp(), and ilObjTestGUITest\setUp().

245  : void
246  {
247  $this->setGlobalVariable("ilToolbar", $this->createMock(ilToolbarGUI::class));
248  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilUser()

ilTestBaseTestCase::addGlobal_ilUser ( )
protected

◆ addGlobal_lng()

ilTestBaseTestCase::addGlobal_lng ( )
protected

◆ addGlobal_objDefinition()

ilTestBaseTestCase::addGlobal_objDefinition ( )
protected

Definition at line 150 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjAssessmentFolderTest\setUp(), ilTestRandomQuestionSetConfigGUITest\setUp(), ilObjTestGUITest\setUp(), ilObjTestTest\setUp(), ilObjTestVerificationTest\setUp(), ilObjTestSettingsGeneralGUITest\setUp(), setUp(), ilTestExportFactoryTest\testGetExporter(), and ilTestPlayerFactoryTest\testGetPlayerGUI().

150  : void
151  {
152  $this->setGlobalVariable("objDefinition", $this->createMock(ilObjectDefinition::class));
153  }
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 240 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

240  : void
241  {
242  $this->setGlobalVariable("rbacreview", $this->createMock(ilRbacReview::class));
243  }
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 165 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp(), ilTestPlayerRandomQuestionSetGUITest\setUp(), ilTestPlayerFixedQuestionSetGUITest\setUp(), and ilTestPlayerFactoryTest\testGetPlayerGUI().

165  : void
166  {
167  $this->setGlobalVariable("rbacsystem", $this->createMock(ilRbacSystem::class));
168  }
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 285 of file ilTestBaseTestCase.php.

References setGlobalVariable().

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

285  : void
286  {
287  $refineryMock = $this->getMockBuilder(RefineryFactory::class)->disableOriginalConstructor()->getMock();
288  $refineryMock->expects(self::any())->method('random')->willReturn($this->getMockBuilder(RandomGroup::class)->getMock());
289  $this->setGlobalVariable("refinery", $refineryMock);
290  }
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 270 of file ilTestBaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_uiFactory()

ilTestBaseTestCase::addGlobal_uiFactory ( )
protected

Definition at line 275 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilMarkSchemaGUITest\setUp(), ilObjTestSettingsGeneralGUITest\setUp(), ilTestToplistGUITest\setUp(), and ilTestRandomQuestionSetSourcePoolDefinitionListTableGUITest\setUp().

275  : void
276  {
277  $this->setGlobalVariable("ui.factory", $this->createMock(Factory::class));
278  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_uiRenderer()

ilTestBaseTestCase::addGlobal_uiRenderer ( )
protected

Definition at line 280 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilMarkSchemaGUITest\setUp(), ilObjTestSettingsGeneralGUITest\setUp(), ilTestToplistGUITest\setUp(), and ilTestRandomQuestionSetSourcePoolDefinitionListTableGUITest\setUp().

280  : void
281  {
282  $this->setGlobalVariable("ui.renderer", $this->createMock(ILIAS\UI\Implementation\DefaultRenderer::class));
283  }
Class Factory.
Class ChatMainBarProvider .
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_upload()

ilTestBaseTestCase::addGlobal_upload ( )
protected

Definition at line 185 of file ilTestBaseTestCase.php.

References setGlobalVariable().

Referenced by ilObjTestGUITest\setUp().

185  : void
186  {
187  $this->setGlobalVariable("upload", $this->createMock(FileUpload::class));
188  }
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 119 of file ilTestBaseTestCase.php.

120  {
121  return $this->getMockBuilder(ilDBInterface::class)->disableOriginalConstructor()->getMock();
122  }

◆ getGlobalTemplateMock()

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

Definition at line 111 of file ilTestBaseTestCase.php.

112  {
113  return $this->getMockBuilder(ilTemplate::class)->disableOriginalConstructor()->getMock();
114  }

◆ getIliasMock()

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

Definition at line 127 of file ilTestBaseTestCase.php.

Referenced by addGlobal_ilias(), and ilTestSkillAdministrationGUITest\setUp().

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

◆ setGlobalVariable()

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

Definition at line 96 of file ilTestBaseTestCase.php.

References $c, $DIC, $GLOBALS, and $name.

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

96  : void
97  {
98  global $DIC;
99 
100  $GLOBALS[$name] = $value;
101 
102  unset($DIC[$name]);
103  $DIC[$name] = static function (Container $c) use ($value) {
104  return $value;
105  };
106  }
$c
Definition: cli.php:38
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the caller graph for this function:

◆ setUp()

ilTestBaseTestCase::setUp ( )
protected

Definition at line 42 of file ilTestBaseTestCase.php.

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

42  : void
43  {
44  global $DIC;
45 
46  $this->dic = is_object($DIC) ? clone $DIC : $DIC;
47 
48  $DIC = new Container();
49 
50  $this->addGlobal_tpl();
51  $this->addGlobal_ilDB();
52  $this->addGlobal_ilias();
53  $this->addGlobal_ilLog();
54  $this->addGlobal_ilErr();
55  $this->addGlobal_tree();
56  $this->addGlobal_lng();
58  $this->addGlobal_objDefinition();
59  $this->addGlobal_refinery();
60 
61  $this->getMockBuilder(\ILIAS\DI\LoggingServices::class)->disableOriginalConstructor()->getMock();
62 
63  $http_mock = $this
64  ->getMockBuilder(\ILIAS\HTTP\Services::class)
65  ->disableOriginalConstructor()
66  ->onlyMethods(['request', 'wrapper'])->getMock();
67 
68  $request_mock = $this
69  ->getMockBuilder(\GuzzleHttp\Psr7\ServerRequest::class)
70  ->disableOriginalConstructor()
71  ->onlyMethods(['getParsedBody'])->getMock();
72  $request_mock->method('getParsedBody')->willReturn(array());
73  $http_mock->method('request')->willReturn($request_mock);
74 
75  $wrapper_mock = $this->createMock(\ILIAS\HTTP\Wrapper\WrapperFactory::class);
76  $http_mock->method('wrapper')->willReturn($wrapper_mock);
77 
78  $this->setGlobalVariable('http', $http_mock);
79 
80  parent::setUp();
81  }
Class ChatMainBarProvider .
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
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 83 of file ilTestBaseTestCase.php.

References $DIC, and $dic.

83  : void
84  {
85  global $DIC;
86 
87  $DIC = $this->dic;
88 
89  parent::tearDown();
90  }
global $DIC
Definition: feed.php:28

Field Documentation

◆ $dic

Container ilTestBaseTestCase::$dic = null
protected

Definition at line 37 of file ilTestBaseTestCase.php.

Referenced by tearDown().


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