ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilChatroomAbstractTest Class Reference

Class ilChatroomAbstractTest. More...

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

Protected Member Functions

 setUp ()
 
 tearDown ()
 
 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 77 of file class.ilChatroomAbstractTest.php.

References setGlobalVariable().

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

78  {
79  $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
80  $db->method('quote')->willReturnCallback(static function ($arg): string {
81  return "'" . $arg . "'";
82  });
83 
84  $this->setGlobalVariable('ilDB', $db);
85 
86  return $db;
87  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createIlChatroomUserMock()

ilChatroomAbstractTest::createIlChatroomUserMock ( )
protected
Returns
ilChatroomUser&MockObject

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

References $ilChatroomUserMock.

Referenced by ilObjChatroomTest\setUp().

66  {
67  $this->ilChatroomUserMock = $this->getMockBuilder(ilChatroomUser::class)->disableOriginalConstructor()->onlyMethods(
68  ['getUserId', 'getUsername']
69  )->getMock();
70 
72  }
Class ilChatroomUser.
+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

◆ setUp()

ilChatroomAbstractTest::setUp ( )
protected

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

References $DIC, and setGlobalVariable().

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  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
global $DIC
Definition: feed.php:28
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ tearDown()

ilChatroomAbstractTest::tearDown ( )
protected

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

References $DIC, and $dic.

53  : void
54  {
55  global $DIC;
56 
57  $DIC = $this->dic;
58 
59  parent::tearDown();
60  }
global $DIC
Definition: feed.php:28

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.

◆ $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: