ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

65 : ilDBInterface&MockObject
66 {
67 $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
68 $db->method('quote')->willReturnCallback(static fn($arg): string => "'" . $arg . "'");
69
70 $this->setGlobalVariable('ilDB', $db);
71
72 return $db;
73 }
Interface ilDBInterface.

References setGlobalVariable().

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

+ 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.

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.

References $ilChatroomUserMock.

Referenced by ilObjChatroomTest\setUp().

+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

◆ setUp()

ilChatroomAbstractTestBase::setUp ( )
protected

Reimplemented in ilChatroomAbstractTaskTestBase, ilChatroomUserTest, ilObjChatroomAccessTest, ilObjChatroomAdminAccessTest, and ilObjChatroomTest.

Definition at line 31 of file ilChatroomAbstractTestBase.php.

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 }

References $DIC, and setGlobalVariable().

+ Here is the call graph for this function:

◆ tearDown()

ilChatroomAbstractTestBase::tearDown ( )
protected

Definition at line 47 of file ilChatroomAbstractTestBase.php.

47 : void
48 {
49 global $DIC;
50
52
53 parent::tearDown();
54 }

References $DIC, and $dic.

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: