ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilChatroomAbstractTestBase Class Reference
+ Inheritance diagram for ilChatroomAbstractTestBase:
+ Collaboration diagram for ilChatroomAbstractTestBase:

Protected Member Functions

 setUp ()
 
 tearDown ()
 
 createIlChatroomUserMock ()
 
 createGlobalIlDBMock ()
 
 setGlobalVariable (string $name, $value)
 

Protected Attributes

MockObject &ilChatroom $ilChatroomMock
 
MockObject &ilChatroomUser $ilChatroomUserMock
 

Private Attributes

Container $dic = null
 

Detailed Description

Definition at line 25 of file ilChatroomAbstractTestBase.php.

Member Function Documentation

◆ createGlobalIlDBMock()

ilChatroomAbstractTestBase::createGlobalIlDBMock ( )
protected

Definition at line 65 of file ilChatroomAbstractTestBase.php.

References setGlobalVariable().

Referenced by ilObjChatroomAccessTest\setUp(), ilObjChatroomTest\testPublicRoomObjIdCanBeRetrieved(), and ilObjChatroomTest\testPublicRoomObjIdDefaultValueCanBeRetrieved().

65  : ilDBInterface&MockObject
66  {
67  $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
68  $db->method('quote')->willReturnCallback(static function ($arg): string {
69  return "'" . $arg . "'";
70  });
71 
72  $this->setGlobalVariable('ilDB', $db);
73 
74  return $db;
75  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createIlChatroomUserMock()

ilChatroomAbstractTestBase::createIlChatroomUserMock ( )
protected

Definition at line 56 of file ilChatroomAbstractTestBase.php.

References $ilChatroomUserMock.

Referenced by ilObjChatroomTest\setUp().

56  : ilChatroomUser&MockObject
57  {
58  $this->ilChatroomUserMock = $this->getMockBuilder(ilChatroomUser::class)->disableOriginalConstructor()->onlyMethods(
59  ['getUserId', 'getUsername']
60  )->getMock();
61 
63  }
MockObject &ilChatroomUser $ilChatroomUserMock
Class ilChatroomUser.
+ Here is the caller graph for this function:

◆ setGlobalVariable()

ilChatroomAbstractTestBase::setGlobalVariable ( string  $name,
  $value 
)
protected

◆ setUp()

ilChatroomAbstractTestBase::setUp ( )
protected

Definition at line 31 of file ilChatroomAbstractTestBase.php.

References $DIC, and setGlobalVariable().

31  : void
32  {
33  global $DIC;
34 
35  $this->dic = is_object($DIC) ? clone $DIC : $DIC;
36 
37  $DIC = new Container();
38 
39  $this->setGlobalVariable(
40  'tpl',
41  $this->getMockBuilder(ilGlobalTemplateInterface::class)->getMock()
42  );
43 
44  parent::setUp();
45  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ tearDown()

ilChatroomAbstractTestBase::tearDown ( )
protected

Definition at line 47 of file ilChatroomAbstractTestBase.php.

References $DIC, and $dic.

47  : void
48  {
49  global $DIC;
50 
51  $DIC = $this->dic;
52 
53  parent::tearDown();
54  }
global $DIC
Definition: shib_login.php:22

Field Documentation

◆ $dic

Container ilChatroomAbstractTestBase::$dic = null
private

Definition at line 29 of file ilChatroomAbstractTestBase.php.

Referenced by tearDown().

◆ $ilChatroomMock

MockObject& ilChatroom ilChatroomAbstractTestBase::$ilChatroomMock
protected

Definition at line 27 of file ilChatroomAbstractTestBase.php.

◆ $ilChatroomUserMock

MockObject& ilChatroomUser ilChatroomAbstractTestBase::$ilChatroomUserMock
protected

Definition at line 28 of file ilChatroomAbstractTestBase.php.

Referenced by createIlChatroomUserMock().


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