ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References $DIC, and setGlobalVariable().

Referenced by setUp().

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:35
global $DIC
Definition: shib_login.php:22
setGlobalVariable(string $name, $value)
+ 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.

References $c, $DIC, and $GLOBALS.

Referenced by initDependencies().

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
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:53
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ setUp()

ilPrivacySettingsTest::setUp ( )
protected

Definition at line 33 of file ilPrivacySettingsTest.php.

References initDependencies().

33  : void
34  {
35  $this->initDependencies();
36  parent::setUp();
37  }
+ Here is the call graph for this function:

◆ tearDown()

ilPrivacySettingsTest::tearDown ( )
protected

Definition at line 39 of file ilPrivacySettingsTest.php.

References $DIC, and $dic.

39  : void
40  {
41  global $DIC;
42 
43  $DIC = $this->dic;
44 
45  parent::tearDown();
46  }
global $DIC
Definition: shib_login.php:22

◆ testConstruct()

ilPrivacySettingsTest::testConstruct ( )

Definition at line 48 of file ilPrivacySettingsTest.php.

References ilPrivacySettings\getInstance().

48  : void
49  {
50  $settings = ilPrivacySettings::getInstance();
51  $this->assertInstanceOf(ilPrivacySettings::class, $settings);
52  }
+ 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: