ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables 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 13 of file ilPrivacySettingsTest.php.

Member Function Documentation

◆ initDependencies()

ilPrivacySettingsTest::initDependencies ( )
protected

Definition at line 49 of file ilPrivacySettingsTest.php.

References $DIC, and setGlobalVariable().

Referenced by setUp().

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:31
global $DIC
Definition: feed.php:28
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 38 of file ilPrivacySettingsTest.php.

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

Referenced by initDependencies().

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  }
$c
Definition: cli.php:38
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the caller graph for this function:

◆ setUp()

ilPrivacySettingsTest::setUp ( )
protected

Definition at line 17 of file ilPrivacySettingsTest.php.

References initDependencies().

17  : void
18  {
19  $this->initDependencies();
20  parent::setUp();
21  }
+ Here is the call graph for this function:

◆ tearDown()

ilPrivacySettingsTest::tearDown ( )
protected

Definition at line 23 of file ilPrivacySettingsTest.php.

References $dic, and $DIC.

23  : void
24  {
25  global $DIC;
26 
27  $DIC = $this->dic;
28 
29  parent::tearDown();
30  }
global $DIC
Definition: feed.php:28

◆ testConstruct()

ilPrivacySettingsTest::testConstruct ( )

Definition at line 32 of file ilPrivacySettingsTest.php.

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

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
+ 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: