ILIAS  release_8 Revision v8.24
ilChatroomAbstractTest Class Reference

Class ilChatroomAbstractTest. More...

+ Inheritance diagram for ilChatroomAbstractTest:
+ Collaboration diagram for ilChatroomAbstractTest:

Protected Member Functions

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

Protected Attributes

 $ilChatroomMock
 
 $ilChatroomUserMock
 

Private Attributes

Container $dic = null
 

Detailed Description

Member Function Documentation

◆ createGlobalIlDBMock()

ilChatroomAbstractTest::createGlobalIlDBMock ( )
protected
Returns
ilDBInterface&MockObject

Definition at line 89 of file class.ilChatroomAbstractTest.php.

90 {
91 $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
92 $db->method('quote')->willReturnCallback(static function ($arg): string {
93 return "'" . $arg . "'";
94 });
95
96 $this->setGlobalVariable('ilDB', $db);
97
98 return $db;
99 }
setGlobalVariable(string $name, $value)
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:

◆ createIlChatroomMock()

ilChatroomAbstractTest::createIlChatroomMock ( )
protected
Returns
ilChatroom&MockObject

Definition at line 65 of file class.ilChatroomAbstractTest.php.

66 {
67 $this->ilChatroomMock = $this->getMockBuilder(ilChatroom::class)->disableOriginalConstructor()->onlyMethods(
68 ['isOwnerOfPrivateRoom', 'clearMessages']
69 )->getMock();
70
72 }
Class ilChatroom.

References $ilChatroomMock.

◆ createIlChatroomUserMock()

ilChatroomAbstractTest::createIlChatroomUserMock ( )
protected
Returns
ilChatroomUser&MockObject

Definition at line 77 of file class.ilChatroomAbstractTest.php.

78 {
79 $this->ilChatroomUserMock = $this->getMockBuilder(ilChatroomUser::class)->disableOriginalConstructor()->onlyMethods(
80 ['getUserId', 'getUsername']
81 )->getMock();
82
84 }
Class ilChatroomUser.

References $ilChatroomUserMock.

Referenced by ilObjChatroomTest\setUp().

+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 101 of file class.ilChatroomAbstractTest.php.

101 : void
102 {
103 global $DIC;
104
105 $GLOBALS[$name] = $value;
106
107 $DIC[$name] = static function (Container $c) use ($name) {
108 return $GLOBALS[$name];
109 };
110 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247

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

Referenced by ilChatroomAbstractTaskTest\createGlobalIlCtrlMock(), createGlobalIlDBMock(), ilChatroomAbstractTaskTest\createGlobalIlLanguageMock(), ilChatroomAbstractTaskTest\createGlobalIlUserMock(), ilChatroomAbstractTaskTest\createGlobalRbacSystemMock(), setUp(), ilObjChatroomAdminAccessTest\setUp(), ilObjChatroomAccessTest\testAccessChecksFail(), ilObjChatroomAccessTest\testAccessChecksSucceed(), ilObjChatroomAccessTest\testGotoCheckFails(), and ilObjChatroomAccessTest\testGotoCheckSucceeds().

+ Here is the caller graph for this function:

◆ setUp()

ilChatroomAbstractTest::setUp ( )
protected

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

Definition at line 37 of file class.ilChatroomAbstractTest.php.

37 : void
38 {
39 global $DIC;
40
41 $this->dic = is_object($DIC) ? clone $DIC : $DIC;
42
43 $DIC = new Container();
44
45 $this->setGlobalVariable(
46 'tpl',
47 $this->getMockBuilder(ilGlobalTemplateInterface::class)->getMock()
48 );
49
50 parent::setUp();
51 }

References $DIC, and setGlobalVariable().

+ Here is the call graph for this function:

◆ tearDown()

ilChatroomAbstractTest::tearDown ( )
protected

Definition at line 53 of file class.ilChatroomAbstractTest.php.

53 : void
54 {
55 global $DIC;
56
58
59 parent::tearDown();
60 }

References $DIC, and $dic.

Field Documentation

◆ $dic

Container ilChatroomAbstractTest::$dic = null
private

Definition at line 35 of file class.ilChatroomAbstractTest.php.

Referenced by tearDown().

◆ $ilChatroomMock

ilChatroomAbstractTest::$ilChatroomMock
protected

Definition at line 32 of file class.ilChatroomAbstractTest.php.

Referenced by createIlChatroomMock().

◆ $ilChatroomUserMock

ilChatroomAbstractTest::$ilChatroomUserMock
protected

Definition at line 34 of file class.ilChatroomAbstractTest.php.

Referenced by createIlChatroomUserMock().


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