ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 50 of file ilInitialisationTest.php.

50 {
51 return array
52 ( array("ilDBInterface", function ($DIC) { return $DIC->database(); })
53 , array("ilCtrl", function ($DIC) { return $DIC->ctrl(); })
54 , array("ilObjUser", function ($DIC) { return $DIC->user(); })
55 , array("ilRbacSystem", function ($DIC) { return $DIC->rbac()->system(); })
56 , array("ilRbacAdmin", function ($DIC) { return $DIC->rbac()->admin(); })
57 , array("ilRbacReview", function ($DIC) { return $DIC->rbac()->review(); })
58 , array("ilAccessHandler", function ($DIC) { return $DIC->access(); })
59 , array("ilTree", function ($DIC) { return $DIC->repositoryTree(); })
60 , array("ilLanguage", function ($DIC) { return $DIC->language(); })
61 // TODO: Can't test these until context for unit tests does not have HTML.
62 //, array("ilTemplate", function ($DIC) { return $DIC->ui()->mainTemplate(); })
63 //, array("ilToolbarGUI", function ($DIC) { return $DIC->toolbar(); })
64 //, array("ilTabsGUI", function ($DIC) { return $DIC->tabs(); })
65 //, array("ILIAS\\UI\\Factory", function ($DIC) { return $DIC->ui()->factory();})
66 //, array("ILIAS\\UI\\Renderer", function ($DIC) { return $DIC->ui()->renderer();})
67 , array("ilLogger", function ($DIC) { return $DIC->logger()->root(); })
68 , array("ilLogger", function ($DIC) { return $DIC->logger()->grp(); })
69 , array("ilLogger", function ($DIC) { return $DIC->logger()->crs(); })
70 , array("ilLogger", function ($DIC) { return $DIC->logger()->tree(); })
71 );
72 }
global $DIC

References $DIC.

◆ globalsProvider()

ilInitialisationTest::globalsProvider ( )

Definition at line 39 of file ilInitialisationTest.php.

39 {
40 // Add combinations of globals and their classes here...
41 return array
42 ( array("ilIliasIniFile", "ilIniFile")
43 , array("ilCtrl", "ilCtrl")
44 , array("tree", "ilTree")
45 , array("ilLog", "ilLogger")
46 , array("ilDB", "ilDBInterface")
47 );
48 }

◆ setUp()

ilInitialisationTest::setUp ( )
protected

Definition at line 11 of file ilInitialisationTest.php.

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

◆ test_DIC()

ilInitialisationTest::test_DIC (   $global_name,
  $class_name 
)

@dataProvider globalsProvider

Definition at line 21 of file ilInitialisationTest.php.

21 {
22 global $DIC;
23
24 $this->assertInstanceOf($class_name, $GLOBALS[$global_name]);
25 $this->assertInstanceOf($class_name, $DIC[$global_name]);
26 $this->assertSame($GLOBALS[$global_name], $DIC[$global_name]);
27 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $DIC, and $GLOBALS.

◆ test_DIC_getters()

ilInitialisationTest::test_DIC_getters (   $class_name,
  $getter 
)

@dataProvider getterProvider

Definition at line 32 of file ilInitialisationTest.php.

32 {
33 global $DIC;
34
35 $service = $getter($DIC);
36 $this->assertInstanceOf($class_name, $service);
37 }

References $DIC.

Field Documentation

◆ $backupGlobals

ilInitialisationTest::$backupGlobals = FALSE
protected

Definition at line 9 of file ilInitialisationTest.php.


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