ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilLDAPServerTest Class Reference

Class ilSessionTest. More...

+ Inheritance diagram for ilLDAPServerTest:
+ Collaboration diagram for ilLDAPServerTest:

Protected Member Functions

 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, mixed $value)
 
 getLanguageMock ()
 

Private Attributes

Container $dic = null
 

Detailed Description

Class ilSessionTest.

Definition at line 28 of file ilLDAPServerTest.php.

Member Function Documentation

◆ getLanguageMock()

ilLDAPServerTest::getLanguageMock ( )
protected
Returns
MockObject|ilLanguage

Definition at line 88 of file ilLDAPServerTest.php.

89 {
90 $lng = $this
91 ->getMockBuilder(ilLanguage::class)
92 ->disableOriginalConstructor()
93 ->onlyMethods(['txt', 'getInstalledLanguages', 'loadLanguageModule'])
94 ->getMock();
95
96 return $lng;
97 }
language handling
global $lng
Definition: privfeed.php:31

References $lng.

Referenced by setUp().

+ Here is the caller graph for this function:

◆ setGlobalVariable()

ilLDAPServerTest::setGlobalVariable ( string  $name,
mixed  $value 
)
protected

Definition at line 75 of file ilLDAPServerTest.php.

75 : void
76 {
77 global $DIC;
78
79 $GLOBALS[$name] = $value;
80
81 unset($DIC[$name]);
82 $DIC[$name] = static fn(Container $c) => $GLOBALS[$name];
83 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
$c
Definition: deliver.php:25
global $DIC
Definition: shib_login.php:26
$GLOBALS["DIC"]
Definition: wac.php:54

References $c, $DIC, and $GLOBALS.

Referenced by setUp().

+ Here is the caller graph for this function:

◆ setUp()

ilLDAPServerTest::setUp ( )
protected

Definition at line 32 of file ilLDAPServerTest.php.

32 : void
33 {
34 global $DIC;
35
36 $this->dic = is_object($DIC) ? clone $DIC : $DIC;
37
38 $DIC = new Container();
39
40 $this->setGlobalVariable('lng', $this->getLanguageMock());
41 $this->setGlobalVariable(
42 'ilDB',
43 $this->getMockBuilder(ilDBInterface::class)->disableAutoReturnValueGeneration()->getMock()
44 );
45
46 $this->setGlobalVariable(
47 'ilSetting',
48 $this->getMockBuilder(\ILIAS\Administration\Setting::class)->getMock()
49 );
50 $this->setGlobalVariable(
51 'ilErr',
52 $this->getMockBuilder(ilErrorHandling::class)->disableOriginalConstructor()->getMock()
53 );
54
55 $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMockForAbstractClass();
56 $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)->disableOriginalConstructor()->getMock();
57 $logger_factory->method('getComponentLogger')->willReturn($logger);
58 $this->setGlobalVariable(
59 ilLoggerFactory::class,
60 $logger_factory
61 );
62
63 parent::setUp();
64 }
setGlobalVariable(string $name, mixed $value)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References $DIC, getLanguageMock(), and setGlobalVariable().

+ Here is the call graph for this function:

◆ tearDown()

ilLDAPServerTest::tearDown ( )
protected

Definition at line 66 of file ilLDAPServerTest.php.

66 : void
67 {
68 global $DIC;
69
71
72 parent::tearDown();
73 }

References $DIC, and $dic.

Field Documentation

◆ $dic

Container ilLDAPServerTest::$dic = null
private

Definition at line 30 of file ilLDAPServerTest.php.

Referenced by tearDown().


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