ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilLDAPServerTest Class Reference

Class ilSessionTest. More...

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

Protected Member Functions

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

Private Attributes

Container $dic
 

Detailed Description

Class ilSessionTest.

Definition at line 30 of file ilLDAPServerTest.php.

Member Function Documentation

◆ getLanguageMock()

ilLDAPServerTest::getLanguageMock ( )
protected
Returns
MockObject|ilLanguage

Definition at line 75 of file ilLDAPServerTest.php.

References $data, $DIC, $ilDB, $lng, $res, $server, and ilSession\SESSION_HANDLING_FIXED.

Referenced by setUp().

75  : ilLanguage
76  {
77  $lng = $this
78  ->getMockBuilder(ilLanguage::class)
79  ->disableOriginalConstructor()
80  ->onlyMethods(['txt', 'getInstalledLanguages', 'loadLanguageModule'])
81  ->getMock();
82 
83  return $lng;
84  }
$lng
+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 60 of file ilLDAPServerTest.php.

References Vendor\Package\$c, $DIC, and $GLOBALS.

Referenced by setUp().

60  : void
61  {
62  global $DIC;
63 
64  $GLOBALS[$name] = $value;
65 
66  unset($DIC[$name]);
67  $DIC[$name] = static function ($c) use ($name) {
68  return $GLOBALS[$name];
69  };
70  }
global $DIC
Definition: feed.php:28
$GLOBALS["DIC"]
Definition: wac.php:31
+ Here is the caller graph for this function:

◆ setUp()

ilLDAPServerTest::setUp ( )
protected

Definition at line 34 of file ilLDAPServerTest.php.

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

34  : void
35  {
36  $this->dic = new Container();
37  $GLOBALS['DIC'] = $this->dic;
38 
39  $this->setGlobalVariable('lng', $this->getLanguageMock());
40  $this->setGlobalVariable(
41  'ilDB',
42  $this->getMockBuilder(ilDBInterface::class)->disableAutoReturnValueGeneration()->getMock()
43  );
44 
45  $this->setGlobalVariable(
46  'ilSetting',
47  $this->getMockBuilder(\ILIAS\Administration\Setting::class)->getMock()
48  );
49  $this->setGlobalVariable(
50  'ilErr',
51  $this->getMockBuilder(ilErrorHandling::class)->getMock()
52  );
53  parent::setUp();
54  }
Class ChatMainBarProvider .
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:31
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

Field Documentation

◆ $dic

Container ilLDAPServerTest::$dic
private

Definition at line 32 of file ilLDAPServerTest.php.

Referenced by setUp().


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