ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilScorm2004BaseTestCase Class Reference

Class ilScorm2004BaseTestCase. More...

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

Protected Member Functions

 setUp ()
 
 setGlobalVariable (string $name, mixed $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 124 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_http()

ilScorm2004BaseTestCase::addGlobal_http ( )
protected

Definition at line 194 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilAccess()

ilScorm2004BaseTestCase::addGlobal_ilAccess ( )
protected

Definition at line 84 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilAppEventHandler()

ilScorm2004BaseTestCase::addGlobal_ilAppEventHandler ( )
protected

Definition at line 154 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilCtrl()

ilScorm2004BaseTestCase::addGlobal_ilCtrl ( )
protected

Definition at line 114 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilDB()

ilScorm2004BaseTestCase::addGlobal_ilDB ( )
protected

Definition at line 134 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

Referenced by ilScorm2004TrackingItemsTest\setUp().

134  : void
135  {
136  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
137  }
setGlobalVariable(string $name, mixed $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 149 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

Referenced by ilScorm2004TrackingItemsTest\setUp().

149  : void
150  {
151  $this->setGlobalVariable("ilErr", $this->createMock(ilErrorHandling::class));
152  }
setGlobalVariable(string $name, mixed $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 209 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilias()

ilScorm2004BaseTestCase::addGlobal_ilias ( )
protected

Definition at line 144 of file ilScorm2004BaseTestCase.php.

References getIliasMock(), and setGlobalVariable().

Referenced by ilScorm2004TrackingItemsTest\setUp().

144  : void
145  {
146  $this->setGlobalVariable("ilias", $this->getIliasMock());
147  }
setGlobalVariable(string $name, mixed $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 199 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilLocator()

ilScorm2004BaseTestCase::addGlobal_ilLocator ( )
protected

Definition at line 179 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilLog()

ilScorm2004BaseTestCase::addGlobal_ilLog ( )
protected

Definition at line 139 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilLoggerFactory()

ilScorm2004BaseTestCase::addGlobal_ilLoggerFactory ( )
protected

Definition at line 204 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilObjDataCache()

ilScorm2004BaseTestCase::addGlobal_ilObjDataCache ( )
protected

Definition at line 174 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilPluginAdmin()

ilScorm2004BaseTestCase::addGlobal_ilPluginAdmin ( )
protected

Definition at line 164 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilSetting()

ilScorm2004BaseTestCase::addGlobal_ilSetting ( )
protected

Definition at line 104 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilTabs()

ilScorm2004BaseTestCase::addGlobal_ilTabs ( )
protected

Definition at line 169 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilToolbar()

ilScorm2004BaseTestCase::addGlobal_ilToolbar ( )
protected

Definition at line 189 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_ilUser()

ilScorm2004BaseTestCase::addGlobal_ilUser ( )
protected

Definition at line 89 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_lng()

ilScorm2004BaseTestCase::addGlobal_lng ( )
protected

Definition at line 119 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

Referenced by ilScorm2004TrackingItemsTest\setUp().

119  : void
120  {
121  $this->setGlobalVariable("lng", $this->createMock(ilLanguage::class));
122  }
setGlobalVariable(string $name, mixed $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 94 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_rbacreview()

ilScorm2004BaseTestCase::addGlobal_rbacreview ( )
protected

Definition at line 184 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_rbacsystem()

ilScorm2004BaseTestCase::addGlobal_rbacsystem ( )
protected

Definition at line 109 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_refinery()

ilScorm2004BaseTestCase::addGlobal_refinery ( )
protected

Definition at line 224 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_tpl()

ilScorm2004BaseTestCase::addGlobal_tpl ( )
protected

Definition at line 159 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_tree()

ilScorm2004BaseTestCase::addGlobal_tree ( )
protected

Definition at line 99 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ addGlobal_uiFactory()

ilScorm2004BaseTestCase::addGlobal_uiFactory ( )
protected

Definition at line 214 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

214  : void
215  {
216  $this->setGlobalVariable("ui.factory", $this->createMock(FactoryInternal::class));
217  }
setGlobalVariable(string $name, mixed $value)
+ Here is the call graph for this function:

◆ addGlobal_uiRenderer()

ilScorm2004BaseTestCase::addGlobal_uiRenderer ( )
protected

Definition at line 219 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

219  : void
220  {
221  $this->setGlobalVariable("ui.renderer", $this->createMock(ILIAS\UI\Implementation\DefaultRenderer::class));
222  }
Interface Observer Contains several chained tasks and infos about them.
setGlobalVariable(string $name, mixed $value)
+ Here is the call graph for this function:

◆ addGlobal_upload()

ilScorm2004BaseTestCase::addGlobal_upload ( )
protected

Definition at line 129 of file ilScorm2004BaseTestCase.php.

References setGlobalVariable().

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

◆ getDatabaseMock()

ilScorm2004BaseTestCase::getDatabaseMock ( )
protected

Definition at line 66 of file ilScorm2004BaseTestCase.php.

66  : MockObject
67  {
68  return $this->getMockBuilder(ilDBInterface::class)->disableOriginalConstructor()->getMock();
69  }

◆ getGlobalTemplateMock()

ilScorm2004BaseTestCase::getGlobalTemplateMock ( )
protected

Definition at line 61 of file ilScorm2004BaseTestCase.php.

61  : MockObject
62  {
63  return $this->getMockBuilder(ilTemplate::class)->disableOriginalConstructor()->getMock();
64  }

◆ getIliasMock()

ilScorm2004BaseTestCase::getIliasMock ( )
protected

Definition at line 71 of file ilScorm2004BaseTestCase.php.

Referenced by addGlobal_ilias().

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

◆ setGlobalVariable()

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

Definition at line 51 of file ilScorm2004BaseTestCase.php.

References $c, $DIC, and $GLOBALS.

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().

51  : void
52  {
53  global $DIC;
54 
55  $GLOBALS[$name] = $value;
56 
57  unset($DIC[$name]);
58  $DIC[$name] = static fn(\ILIAS\DI\Container $c) => $value;
59  }
Interface Observer Contains several chained tasks and infos about them.
$c
Definition: deliver.php:25
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:53
Class HTTPServicesTest.
global $DIC
Definition: shib_login.php:22
+ 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:35
$GLOBALS["DIC"]
Definition: wac.php:53

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: