ILIAS  release_8 Revision v8.24
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 13 of file ilPrivacySettingsTest.php.

Member Function Documentation

◆ initDependencies()

ilPrivacySettingsTest::initDependencies ( )
protected

Definition at line 49 of file ilPrivacySettingsTest.php.

49 : void
50 {
51 global $DIC;
52
53 $this->dic = is_object($DIC) ? clone $DIC : $DIC;
54
55 $DIC = new Container();
56
57 if (!defined('SYSTEM_FOLDER_ID')) {
58 define('SYSTEM_FOLDER_ID', 9);
59 }
60
61 $this->setGlobalVariable('ilDB', $this->createMock(ilDBInterface::class));
62 $this->setGlobalVariable('ilSetting', $this->getMockBuilder(ilSetting::class)->disableOriginalConstructor()->getMock());
63 $this->setGlobalVariable('ilUser', $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock());
64 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
setGlobalVariable(string $name, $value)
global $DIC
Definition: feed.php:28

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 38 of file ilPrivacySettingsTest.php.

38 : void
39 {
40 global $DIC;
41
42 $GLOBALS[$name] = $value;
43 unset($DIC[$name]);
44 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
45 return $value;
46 };
47 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$c
Definition: cli.php:38
if($format !==null) $name
Definition: metadata.php:247

References $c, $DIC, $GLOBALS, and $name.

Referenced by initDependencies().

+ Here is the caller graph for this function:

◆ setUp()

ilPrivacySettingsTest::setUp ( )
protected

Definition at line 17 of file ilPrivacySettingsTest.php.

17 : void
18 {
19 $this->initDependencies();
20 parent::setUp();
21 }

References initDependencies().

+ Here is the call graph for this function:

◆ tearDown()

ilPrivacySettingsTest::tearDown ( )
protected

Definition at line 23 of file ilPrivacySettingsTest.php.

23 : void
24 {
25 global $DIC;
26
28
29 parent::tearDown();
30 }

References $DIC, and $dic.

◆ testConstruct()

ilPrivacySettingsTest::testConstruct ( )

Definition at line 32 of file ilPrivacySettingsTest.php.

32 : void
33 {
35 $this->assertInstanceOf(ilPrivacySettings::class, $settings);
36 }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References ILIAS\LTI\ToolProvider\$settings, and ilPrivacySettings\getInstance().

+ Here is the call graph for this function:

Field Documentation

◆ $dic

Container ilPrivacySettingsTest::$dic = null
protected

Definition at line 15 of file ilPrivacySettingsTest.php.

Referenced by tearDown().


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