ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilRPCServerSettingsTest Class Reference

Unit tests for class ilRPCServerSettings. More...

+ Inheritance diagram for ilRPCServerSettingsTest:
+ Collaboration diagram for ilRPCServerSettingsTest:

Public Member Functions

 testConstruct ()
 

Protected Member Functions

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

Protected Attributes

Container $dic
 

Detailed Description

Unit tests for class ilRPCServerSettings.

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

Definition at line 29 of file ilRPCServerSettingsTest.php.

Member Function Documentation

◆ initDependencies()

ilRPCServerSettingsTest::initDependencies ( )
protected

Definition at line 56 of file ilRPCServerSettingsTest.php.

References $dic, $GLOBALS, and setGlobalVariable().

Referenced by setUp().

56  : void
57  {
58  $this->dic = new Container();
59  $GLOBALS['DIC'] = $this->dic;
60 
61  $this->setGlobalVariable('ilSetting', $this->createMock(ilSetting::class));
62 
63  $logger = $this->getMockBuilder(ilLogger::class)
64  ->disableOriginalConstructor()
65  ->getMock();
66 
67  $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)
68  ->disableOriginalConstructor()
69  ->onlyMethods(['getComponentLogger'])
70  ->getMock();
71  $logger_factory->method('getComponentLogger')->willReturn($logger);
72  $this->setGlobalVariable('ilLoggerFactory', $logger_factory);
73  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:53
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 45 of file ilRPCServerSettingsTest.php.

References $c, $DIC, and $GLOBALS.

Referenced by initDependencies().

45  : void
46  {
47  global $DIC;
48 
49  $GLOBALS[$name] = $value;
50  unset($DIC[$name]);
51  $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
52  return $value;
53  };
54  }
$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()

ilRPCServerSettingsTest::setUp ( )
protected

Definition at line 33 of file ilRPCServerSettingsTest.php.

References initDependencies().

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

◆ testConstruct()

ilRPCServerSettingsTest::testConstruct ( )

Definition at line 39 of file ilRPCServerSettingsTest.php.

References ilRPCServerSettings\getInstance().

39  : void
40  {
41  $rpc_settings = ilRPCServerSettings::getInstance();
42  $this->assertInstanceOf(ilRPCServerSettings::class, $rpc_settings);
43  }
+ Here is the call graph for this function:

Field Documentation

◆ $dic

Container ilRPCServerSettingsTest::$dic
protected

Definition at line 31 of file ilRPCServerSettingsTest.php.

Referenced by initDependencies().


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