ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References $c, $DIC, and $GLOBALS.

Referenced by setMocks().

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
$GLOBALS["DIC"]
Definition: wac.php:53
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ setMocks()

ilRTEBaseTestCase::setMocks ( )
protected

Definition at line 56 of file ilRTEBaseTestCase.php.

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

Referenced by setUp().

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...
$http
Definition: deliver.php:30
setGlobalVariable(string $name, $value)
global $lng
Definition: privfeed.php:31
+ 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.

References $GLOBALS, and setMocks().

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:35
$GLOBALS["DIC"]
Definition: wac.php:53
+ Here is the call graph for this function:

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