ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilRTEBaseTestCase Class Reference

Class ilRTEBaseTestCase. More...

+ Inheritance diagram for ilRTEBaseTestCase:
+ Collaboration diagram for ilRTEBaseTestCase:

Protected Member Functions

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

Detailed Description

Member Function Documentation

◆ setGlobalVariable()

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

Definition at line 44 of file ilRTEBaseTestCase.php.

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

+ Here is the caller graph for this function:

◆ setMocks()

ilRTEBaseTestCase::setMocks ( )
protected

Definition at line 56 of file ilRTEBaseTestCase.php.

56 : void
57 {
58 $tpl_mock = $this->createMock(ilGlobalTemplateInterface::class);
59 $this->setGlobalVariable('tpl', $tpl_mock);
60
61 $lng = $this
62 ->getMockBuilder(ilLanguage::class)
63 ->disableOriginalConstructor()
64 ->onlyMethods(['txt', 'getInstalledLanguages', 'loadLanguageModule'])
65 ->getMock();
66 $this->setGlobalVariable('lng', $lng);
67
68 $this->setGlobalVariable(
69 'ilCtrl',
70 $this->getMockBuilder(ilCtrlInterface::class)->disableOriginalConstructor()->getMock()
71 );
72
73 $this->setGlobalVariable(
74 'ilClientIniFile',
75 $this->getMockBuilder(ilIniFile::class)->disableOriginalConstructor()->getMock()
76 );
77
78 $this->setGlobalVariable(
79 'ilUser',
80 $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock()
81 );
82
83 $http = $this
84 ->getMockBuilder(HttpServiceImpl::class)
85 ->disableOriginalConstructor()
86 ->onlyMethods(['agent'])
87 ->getMock();
88 $http
89 ->method('agent')
90 ->willReturn(new AgentDetermination());
91 $this->setGlobalVariable('http', $http);
92 }
This library is borrowed from the phpGroupWare API http://www.phpgroupware.org/api Modifications made...
setGlobalVariable(string $name, $value)
$http
Definition: deliver.php:30
global $lng
Definition: privfeed.php:31

References $http, $lng, and setGlobalVariable().

Referenced by setUp().

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

◆ setUp()

ilRTEBaseTestCase::setUp ( )
protected

Definition at line 32 of file ilRTEBaseTestCase.php.

32 : void
33 {
34 $GLOBALS['DIC'] = new Container();
35 $this->setMocks();
36
37 parent::setUp();
38 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36

References $GLOBALS, and setMocks().

+ Here is the call graph for this function:

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