ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ilLDAPServerTest Class Reference
+ 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

Definition at line 25 of file ilLDAPServerTest.php.

Member Function Documentation

◆ getLanguageMock()

ilLDAPServerTest::getLanguageMock ( )
protected

Definition at line 88 of file ilLDAPServerTest.php.

88 : MockObject&ilLanguage
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:26

References $lng.

Referenced by setUp().

+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 78 of file ilLDAPServerTest.php.

78 : void
79 {
80 global $DIC;
81
82 $GLOBALS[$name] = $value;
83
84 unset($DIC[$name]);
85 $DIC[$name] = static fn(Container $c) => $GLOBALS[$name];
86 }
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 29 of file ilLDAPServerTest.php.

29 : void
30 {
31 global $DIC;
32
33 $this->dic = is_object($DIC) ? clone $DIC : $DIC;
34
35 $DIC = new Container();
36
37 $this->setGlobalVariable('lng', $this->getLanguageMock());
38 $this->setGlobalVariable(
39 'ilDB',
40 $this->getMockBuilder(ilDBInterface::class)->disableAutoReturnValueGeneration()->getMock()
41 );
42
43 $this->setGlobalVariable(
44 'ilSetting',
45 $this->getMockBuilder(\ILIAS\Administration\Setting::class)->getMock()
46 );
47 $this->setGlobalVariable(
48 'ilErr',
49 $this->getMockBuilder(ilErrorHandling::class)->disableOriginalConstructor()->getMock()
50 );
51
52 $logger = $this
53 ->getMockBuilder(ilLogger::class)
54 ->disableOriginalConstructor()
55 ->getMock();
56 $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)->disableOriginalConstructor()->getMock();
57 $logger_factory
58 ->expects($this->once())
59 ->method('getComponentLogger')
60 ->willReturn($logger);
61 $this->setGlobalVariable(
62 ilLoggerFactory::class,
63 $logger_factory
64 );
65
66 parent::setUp();
67 }
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 69 of file ilLDAPServerTest.php.

69 : void
70 {
71 global $DIC;
72
74
75 parent::tearDown();
76 }

References $DIC, and $dic.

Field Documentation

◆ $dic

Container ilLDAPServerTest::$dic = null
private

Definition at line 27 of file ilLDAPServerTest.php.

Referenced by tearDown().


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