ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilScorm2004BaseTestCase Class Reference

Class ilScorm2004BaseTestCase. More...

+ Inheritance diagram for ilScorm2004BaseTestCase:
+ Collaboration diagram for ilScorm2004BaseTestCase:

Protected Member Functions

 setUp ()
 
 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_ilPluginAdmin ()
 
 addGlobal_ilTabs ()
 
 addGlobal_ilObjDataCache ()
 
 addGlobal_ilLocator ()
 
 addGlobal_rbacreview ()
 
 addGlobal_ilToolbar ()
 
 addGlobal_http ()
 
 addGlobal_ilIliasIniFile ()
 
 addGlobal_ilLoggerFactory ()
 
 addGlobal_ilHelp ()
 
 addGlobal_uiFactory ()
 
 addGlobal_uiRenderer ()
 
 addGlobal_refinery ()
 

Protected Attributes

Container $dic
 

Detailed Description

Member Function Documentation

◆ addGlobal_filesystem()

ilScorm2004BaseTestCase::addGlobal_filesystem ( )
protected

Definition at line 127 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

127  : void
128  {
129  $this->setGlobalVariable("filesystem", $this->createMock(Filesystems::class));
130  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_http()

ilScorm2004BaseTestCase::addGlobal_http ( )
protected

Definition at line 197 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

197  : void
198  {
199  $this->setGlobalVariable("http", $this->createMock(Services::class));
200  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilAccess()

ilScorm2004BaseTestCase::addGlobal_ilAccess ( )
protected

Definition at line 87 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

87  : void
88  {
89  $this->setGlobalVariable("ilAccess", $this->createMock(ilAccess::class));
90  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilAppEventHandler()

ilScorm2004BaseTestCase::addGlobal_ilAppEventHandler ( )
protected

Definition at line 157 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

157  : void
158  {
159  $this->setGlobalVariable("ilAppEventHandler", $this->createMock(ilAppEventHandler::class));
160  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilCtrl()

ilScorm2004BaseTestCase::addGlobal_ilCtrl ( )
protected

Definition at line 117 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

117  : void
118  {
119  $this->setGlobalVariable("ilCtrl", $this->createMock(ilCtrl::class));
120  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilDB()

ilScorm2004BaseTestCase::addGlobal_ilDB ( )
protected

Definition at line 137 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

Referenced by ilScorm2004TrackingItemsTest\setUp().

137  : void
138  {
139  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
140  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilErr()

ilScorm2004BaseTestCase::addGlobal_ilErr ( )
protected

Definition at line 152 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

Referenced by ilScorm2004TrackingItemsTest\setUp().

152  : void
153  {
154  $this->setGlobalVariable("ilErr", $this->createMock(ilErrorHandling::class));
155  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilHelp()

ilScorm2004BaseTestCase::addGlobal_ilHelp ( )
protected

Definition at line 212 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilias()

ilScorm2004BaseTestCase::addGlobal_ilias ( )
protected

Definition at line 147 of file ilScorm2004BaseTestCase.php.

References getIliasMock(), and setGlobalVariable().

Referenced by ilScorm2004TrackingItemsTest\setUp().

147  : void
148  {
149  $this->setGlobalVariable("ilias", $this->getIliasMock());
150  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_ilIliasIniFile()

ilScorm2004BaseTestCase::addGlobal_ilIliasIniFile ( )
protected

Definition at line 202 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

202  : void
203  {
204  $this->setGlobalVariable("ilIliasIniFile", $this->createMock(ilIniFile::class));
205  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilLocator()

ilScorm2004BaseTestCase::addGlobal_ilLocator ( )
protected

Definition at line 182 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

182  : void
183  {
184  $this->setGlobalVariable("ilLocator", $this->createMock(ilLocatorGUI::class));
185  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilLog()

ilScorm2004BaseTestCase::addGlobal_ilLog ( )
protected

Definition at line 142 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

142  : void
143  {
144  $this->setGlobalVariable("ilLog", $this->createMock(ilLogger::class));
145  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilLoggerFactory()

ilScorm2004BaseTestCase::addGlobal_ilLoggerFactory ( )
protected

Definition at line 207 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

207  : void
208  {
209  $this->setGlobalVariable("ilLoggerFactory", $this->createMock(ilLoggerFactory::class));
210  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilObjDataCache()

ilScorm2004BaseTestCase::addGlobal_ilObjDataCache ( )
protected

Definition at line 177 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

177  : void
178  {
179  $this->setGlobalVariable("ilObjDataCache", $this->createMock(ilObjectDataCache::class));
180  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilPluginAdmin()

ilScorm2004BaseTestCase::addGlobal_ilPluginAdmin ( )
protected

Definition at line 167 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilSetting()

ilScorm2004BaseTestCase::addGlobal_ilSetting ( )
protected

Definition at line 107 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

107  : void
108  {
109  $this->setGlobalVariable("ilSetting", $this->createMock(ilSetting::class));
110  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilTabs()

ilScorm2004BaseTestCase::addGlobal_ilTabs ( )
protected

Definition at line 172 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

172  : void
173  {
174  $this->setGlobalVariable("ilTabs", $this->createMock(ilTabsGUI::class));
175  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilToolbar()

ilScorm2004BaseTestCase::addGlobal_ilToolbar ( )
protected

Definition at line 192 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

192  : void
193  {
194  $this->setGlobalVariable("ilToolbar", $this->createMock(ilToolbarGUI::class));
195  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_ilUser()

ilScorm2004BaseTestCase::addGlobal_ilUser ( )
protected

Definition at line 92 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

92  : void
93  {
94  $this->setGlobalVariable("ilUser", $this->createMock(ilObjUser::class));
95  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_lng()

ilScorm2004BaseTestCase::addGlobal_lng ( )
protected

Definition at line 122 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

Referenced by ilScorm2004TrackingItemsTest\setUp().

122  : void
123  {
124  $this->setGlobalVariable("lng", $this->createMock(ilLanguage::class));
125  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlobal_objDefinition()

ilScorm2004BaseTestCase::addGlobal_objDefinition ( )
protected

Definition at line 97 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

97  : void
98  {
99  $this->setGlobalVariable("objDefinition", $this->createMock(ilObjectDefinition::class));
100  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_rbacreview()

ilScorm2004BaseTestCase::addGlobal_rbacreview ( )
protected

Definition at line 187 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

187  : void
188  {
189  $this->setGlobalVariable("rbacreview", $this->createMock(ilRbacReview::class));
190  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_rbacsystem()

ilScorm2004BaseTestCase::addGlobal_rbacsystem ( )
protected

Definition at line 112 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

112  : void
113  {
114  $this->setGlobalVariable("rbacsystem", $this->createMock(ilRbacSystem::class));
115  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_refinery()

ilScorm2004BaseTestCase::addGlobal_refinery ( )
protected

Definition at line 227 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

227  : void
228  {
229  $refineryMock = $this->getMockBuilder(RefineryFactory::class)->disableOriginalConstructor()->getMock();
230  $refineryMock->expects(self::any())->method('random')->willReturn($this->getMockBuilder(RandomGroup::class)->getMock());
231  $this->setGlobalVariable("refinery", $refineryMock);
232  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_tpl()

ilScorm2004BaseTestCase::addGlobal_tpl ( )
protected

Definition at line 162 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

162  : void
163  {
164  $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
165  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_tree()

ilScorm2004BaseTestCase::addGlobal_tree ( )
protected

Definition at line 102 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

102  : void
103  {
104  $this->setGlobalVariable("tree", $this->createMock(ilTree::class));
105  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_uiFactory()

ilScorm2004BaseTestCase::addGlobal_uiFactory ( )
protected

Definition at line 217 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

217  : void
218  {
219  $this->setGlobalVariable("ui.factory", $this->createMock(Factory::class));
220  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ addGlobal_uiRenderer()

ilScorm2004BaseTestCase::addGlobal_uiRenderer ( )
protected

Definition at line 222 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_upload()

ilScorm2004BaseTestCase::addGlobal_upload ( )
protected

Definition at line 132 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

132  : void
133  {
134  $this->setGlobalVariable("upload", $this->createMock(FileUpload::class));
135  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ getDatabaseMock()

ilScorm2004BaseTestCase::getDatabaseMock ( )
protected

Definition at line 69 of file ilScorm2004BaseTestCase.php.

69  : MockObject
70  {
71  return $this->getMockBuilder(ilDBInterface::class)->disableOriginalConstructor()->getMock();
72  }

◆ getGlobalTemplateMock()

ilScorm2004BaseTestCase::getGlobalTemplateMock ( )
protected

Definition at line 64 of file ilScorm2004BaseTestCase.php.

64  : MockObject
65  {
66  return $this->getMockBuilder(ilTemplate::class)->disableOriginalConstructor()->getMock();
67  }

◆ getIliasMock()

ilScorm2004BaseTestCase::getIliasMock ( )
protected

Definition at line 74 of file ilScorm2004BaseTestCase.php.

Referenced by addGlobal_ilias().

74  : MockObject
75  {
76  $mock = $this->getMockBuilder(ILIAS::class)->disableOriginalConstructor()->getMock();
77 
78  $account = new stdClass();
79  $account->id = 6;
80  $account->fullname = 'Esther Tester';
81 
82  $mock->account = $account;
83 
84  return $mock;
85  }
+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 54 of file ilScorm2004BaseTestCase.php.

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

Referenced by addGlobal_filesystem(), addGlobal_http(), addGlobal_ilAccess(), addGlobal_ilAppEventHandler(), addGlobal_ilCtrl(), addGlobal_ilDB(), addGlobal_ilErr(), addGlobal_ilHelp(), addGlobal_ilias(), addGlobal_ilIliasIniFile(), addGlobal_ilLocator(), addGlobal_ilLog(), addGlobal_ilLoggerFactory(), addGlobal_ilObjDataCache(), addGlobal_ilPluginAdmin(), addGlobal_ilSetting(), addGlobal_ilTabs(), addGlobal_ilToolbar(), addGlobal_ilUser(), addGlobal_lng(), addGlobal_objDefinition(), addGlobal_rbacreview(), addGlobal_rbacsystem(), addGlobal_refinery(), addGlobal_tpl(), addGlobal_tree(), addGlobal_uiFactory(), addGlobal_uiRenderer(), and addGlobal_upload().

54  : void
55  {
56  global $DIC;
57 
58  $GLOBALS[$name] = $value;
59 
60  unset($DIC[$name]);
61  $DIC[$name] = static fn (\ILIAS\DI\Container $c) => $value;
62  }
$c
Definition: cli.php:38
Class ChatMainBarProvider .
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
Class HTTPServicesTest.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the caller graph for this function:

◆ setUp()

ilScorm2004BaseTestCase::setUp ( )
protected

Definition at line 43 of file ilScorm2004BaseTestCase.php.

References $dic, and $GLOBALS.

43  : void
44  {
45  $this->dic = new Container();
46  $GLOBALS['DIC'] = $this->dic;
47 
48  parent::setUp();
49  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

Field Documentation

◆ $dic

Container ilScorm2004BaseTestCase::$dic
protected

Definition at line 38 of file ilScorm2004BaseTestCase.php.

Referenced by setUp().


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