ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilInitialisationTest Class Reference

TestCase for the ilContext @group needsInstalledILIAS. More...

+ Inheritance diagram for ilInitialisationTest:
+ Collaboration diagram for ilInitialisationTest:

Public Member Functions

 test_DIC ($global_name, $class_name)
 @dataProvider globalsProvider More...
 
 test_DIC_getters ($class_name, $getter)
 @dataProvider getterProvider More...
 
 globalsProvider ()
 
 getterProvider ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $backupGlobals = false
 

Detailed Description

TestCase for the ilContext @group needsInstalledILIAS.

Author
Richard Klees richa.nosp@m.rd.k.nosp@m.lees@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de

Definition at line 8 of file ilInitialisationTest.php.

Member Function Documentation

◆ getterProvider()

ilInitialisationTest::getterProvider ( )

Definition at line 54 of file ilInitialisationTest.php.

55 {
56 return array( array("ilDBInterface", function ($DIC) {
57 return $DIC->database();
58 })
59 , array("ilCtrl", function ($DIC) {
60 return $DIC->ctrl();
61 })
62 , array("ilObjUser", function ($DIC) {
63 return $DIC->user();
64 })
65 , array("ilRbacSystem", function ($DIC) {
66 return $DIC->rbac()->system();
67 })
68 , array("ilRbacAdmin", function ($DIC) {
69 return $DIC->rbac()->admin();
70 })
71 , array("ilRbacReview", function ($DIC) {
72 return $DIC->rbac()->review();
73 })
74 , array("ilAccess", function ($DIC) {
75 return $DIC->access();
76 })
77 , array("ilTree", function ($DIC) {
78 return $DIC->repositoryTree();
79 })
80 , array("ilLanguage", function ($DIC) {
81 return $DIC->language();
82 })
83 // TODO: Can't test these until context for unit tests does not have HTML.
84 //, array("ilTemplate", function ($DIC) { return $DIC->ui()->mainTemplate(); })
85 //, array("ilToolbarGUI", function ($DIC) { return $DIC->toolbar(); })
86 //, array("ilTabsGUI", function ($DIC) { return $DIC->tabs(); })
87 //, array("ILIAS\\UI\\Factory", function ($DIC) { return $DIC->ui()->factory();})
88 //, array("ILIAS\\UI\\Renderer", function ($DIC) { return $DIC->ui()->renderer();})
89 , array("ilLogger", function ($DIC) {
90 return $DIC->logger()->root();
91 })
92 , array("ilLogger", function ($DIC) {
93 return $DIC->logger()->grp();
94 })
95 , array("ilLogger", function ($DIC) {
96 return $DIC->logger()->crs();
97 })
98 , array("ilLogger", function ($DIC) {
99 return $DIC->logger()->tree();
100 })
101 );
102 }
global $DIC
Definition: saml.php:7

References $DIC.

◆ globalsProvider()

ilInitialisationTest::globalsProvider ( )

Definition at line 43 of file ilInitialisationTest.php.

44 {
45 // Add combinations of globals and their classes here...
46 return array( array("ilIliasIniFile", "ilIniFile")
47 , array("ilCtrl", "ilCtrl")
48 , array("tree", "ilTree")
49 , array("ilLog", "ilLogger")
50 , array("ilDB", "ilDBInterface")
51 );
52 }

◆ setUp()

ilInitialisationTest::setUp ( )
protected

Definition at line 12 of file ilInitialisationTest.php.

13 {
14 PHPUnit_Framework_Error_Deprecated::$enabled = false;
15
16 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
17 ilUnitUtil::performInitialisation();
18 }

◆ test_DIC()

ilInitialisationTest::test_DIC (   $global_name,
  $class_name 
)

@dataProvider globalsProvider

Definition at line 23 of file ilInitialisationTest.php.

24 {
25 global $DIC;
26
27 $this->assertInstanceOf($class_name, $GLOBALS[$global_name]);
28 $this->assertInstanceOf($class_name, $DIC[$global_name]);
29 $this->assertSame($GLOBALS[$global_name], $DIC[$global_name]);
30 }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

References $DIC, and $GLOBALS.

◆ test_DIC_getters()

ilInitialisationTest::test_DIC_getters (   $class_name,
  $getter 
)

@dataProvider getterProvider

Definition at line 35 of file ilInitialisationTest.php.

36 {
37 global $DIC;
38
39 $service = $getter($DIC);
40 $this->assertInstanceOf($class_name, $service);
41 }

References $DIC.

Field Documentation

◆ $backupGlobals

ilInitialisationTest::$backupGlobals = false
protected

Definition at line 10 of file ilInitialisationTest.php.


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