ILIAS  release_7 Revision v7.30-3-g800a261c036
ilRTEBaseTest Class Reference

Class ilRTEBaseTest. More...

+ Inheritance diagram for ilRTEBaseTest:
+ Collaboration diagram for ilRTEBaseTest:

Protected Member Functions

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

Detailed Description

Member Function Documentation

◆ setGlobalVariable()

ilRTEBaseTest::setGlobalVariable ( string  $name,
  $value 
)
protected
Parameters
string$name
$value

Definition at line 29 of file ilRTEBaseTest.php.

29 : void
30 {
31 global $DIC;
32
33 $GLOBALS[$name] = $value;
34
35 unset($DIC[$name]);
36 $DIC[$name] = function ($c) use ($name) {
37 return $GLOBALS[$name];
38 };
39 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$c
Definition: cli.php:37
global $DIC
Definition: goto.php:24
if($format !==null) $name
Definition: metadata.php:230

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

Referenced by setMocks().

+ Here is the caller graph for this function:

◆ setMocks()

ilRTEBaseTest::setMocks ( )
protected

Definition at line 40 of file ilRTEBaseTest.php.

40 {
41 $tpl_mock = $this->getMockBuilder(\ilTemplate::class)->disableOriginalConstructor()->getMock();
42 $this->setGlobalVariable('tpl', $tpl_mock);
43 $lng = $this
44 ->getMockBuilder(ilLanguage::class)
45 ->disableOriginalConstructor()
46 ->setMethods(['txt', 'getInstalledLanguages', 'loadLanguageModule'])
47 ->getMock();
48 $this->setGlobalVariable('lng', $lng);
49 $this->setGlobalVariable(
50 'ilCtrl',
51 $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->getMock()
52 );
53 $this->setGlobalVariable(
54 'ilBrowser',
55 $this->getMockBuilder(ilBrowser::class)->disableOriginalConstructor()->getMock()
56 );
57 $this->setGlobalVariable(
58 'ilClientIniFile',
59 $this->getMockBuilder(ilIniFile::class)->disableOriginalConstructor()->getMock()
60 );
61 $this->setGlobalVariable(
62 'ilUser',
63 $this->getMockBuilder(ilUser::class)->disableOriginalConstructor()->getMock()
64 );
65
66 }
setGlobalVariable(string $name, $value)
$lng

References $lng, and setGlobalVariable().

Referenced by setUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

ilRTEBaseTest::setUp ( )
protected

Reimplemented in ilTinyMCETest.

Definition at line 17 of file ilRTEBaseTest.php.

17 : void
18 {
19 $GLOBALS['DIC'] = new Container();
20 $this->setMocks();
21
22 parent::setUp();
23 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:19

References $GLOBALS, and setMocks().

+ Here is the call graph for this function:

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