ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPrivacySettingsTest Class Reference

Unit tests for class ilPrivacySettingsTest. More...

+ Inheritance diagram for ilPrivacySettingsTest:
+ Collaboration diagram for ilPrivacySettingsTest:

Public Member Functions

 testConstruct ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 initDependencies ()
 

Protected Attributes

Container $dic = null
 

Detailed Description

Unit tests for class ilPrivacySettingsTest.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 29 of file ilPrivacySettingsTest.php.

Member Function Documentation

◆ initDependencies()

ilPrivacySettingsTest::initDependencies ( )
protected

Definition at line 65 of file ilPrivacySettingsTest.php.

65 : void
66 {
67 global $DIC;
68
69 $this->dic = is_object($DIC) ? clone $DIC : $DIC;
70
71 $DIC = new Container();
72
73 if (!defined('SYSTEM_FOLDER_ID')) {
74 define('SYSTEM_FOLDER_ID', 9);
75 }
76
77 $this->setGlobalVariable('ilDB', $this->createMock(ilDBInterface::class));
78 $this->setGlobalVariable('ilSetting', $this->getMockBuilder(ilSetting::class)->disableOriginalConstructor()->getMock());
79 $this->setGlobalVariable('ilUser', $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock());
80 $this->setGlobalVariable('ilAccess', $this->getMockBuilder(ilAccess::class)->disableOriginalConstructor()->getMock());
81 $this->setGlobalVariable('rbacsystem', $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock());
82 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
setGlobalVariable(string $name, $value)
global $DIC
Definition: shib_login.php:26

References $DIC, and setGlobalVariable().

Referenced by setUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGlobalVariable()

ilPrivacySettingsTest::setGlobalVariable ( string  $name,
  $value 
)
protected

Definition at line 54 of file ilPrivacySettingsTest.php.

54 : void
55 {
56 global $DIC;
57
58 $GLOBALS[$name] = $value;
59 unset($DIC[$name]);
60 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
61 return $value;
62 };
63 }
$c
Definition: deliver.php:25
$GLOBALS["DIC"]
Definition: wac.php:54

References $c, $DIC, and $GLOBALS.

Referenced by initDependencies().

+ Here is the caller graph for this function:

◆ setUp()

ilPrivacySettingsTest::setUp ( )
protected

Definition at line 33 of file ilPrivacySettingsTest.php.

33 : void
34 {
35 $this->initDependencies();
36 parent::setUp();
37 }

References initDependencies().

+ Here is the call graph for this function:

◆ tearDown()

ilPrivacySettingsTest::tearDown ( )
protected

Definition at line 39 of file ilPrivacySettingsTest.php.

39 : void
40 {
41 global $DIC;
42
44
45 parent::tearDown();
46 }

References $DIC, and $dic.

◆ testConstruct()

ilPrivacySettingsTest::testConstruct ( )

Definition at line 48 of file ilPrivacySettingsTest.php.

48 : void
49 {
51 $this->assertInstanceOf(ilPrivacySettings::class, $settings);
52 }

References ilPrivacySettings\getInstance().

+ Here is the call graph for this function:

Field Documentation

◆ $dic

Container ilPrivacySettingsTest::$dic = null
protected

Definition at line 31 of file ilPrivacySettingsTest.php.

Referenced by tearDown().


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