ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilChatroomInfoTaskTest Class Reference

Class ilChatroomInfoTaskTest. More...

+ Inheritance diagram for ilChatroomInfoTaskTest:
+ Collaboration diagram for ilChatroomInfoTaskTest:

Public Member Functions

 testExecuteDefault ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilChatroomAbstractTaskTest
 setUp ()
 
 createGlobalIlLanguageMock ()
 
 createGlobalRbacSystemMock ()
 
 createGlobalRbacSystemCheckAccessMock ($permission, $result, $times=null)
 
 createGlobalIlCtrlMock ()
 
 createGlobalIlUserMock ()
 
 createIlObjChatroomGUIMock ($object)
 
 createIlObjChatroomGUIGetConnectorMock ($returnValue)
 
 createIlChatroomIsOwnerOfPrivateRoomMock ($userId, $subRoomId, $result)
 
 createIlChatroomUserGetUserIdMock ($userId)
 
 createIlChatroomServerConnectorMock ($settings)
 
 createIlChatroomServerConnectorFileGetContentsMock ($returnValue)
 
 createIlObjChatroomMock ($id)
 
 createSendResponseMock ($mock, $response)
 
- Protected Member Functions inherited from ilChatroomAbstractTest
 setUp ()
 
 createIlChatroomMock ()
 
 createIlChatroomUserMock ()
 
 createGlobalIlDBMock ()
 

Protected Attributes

 $task
 
- Protected Attributes inherited from ilChatroomAbstractTaskTest
 $gui
 
 $ilChatroomServerConnectorMock
 
 $object
 
- Protected Attributes inherited from ilChatroomAbstractTest
 $ilChatroomMock
 
 $ilChatroomUserMock
 

Additional Inherited Members

- Data Fields inherited from ilChatroomAbstractTaskTest
const TEST_REF_ID = 99
 

Detailed Description

Member Function Documentation

◆ setUp()

ilChatroomInfoTaskTest::setUp ( )
protected

Definition at line 17 of file class.ilChatroomInfoTaskTest.php.

References ilChatroomAbstractTaskTest\createGlobalIlCtrlMock(), ilChatroomAbstractTest\createGlobalIlDBMock(), ilChatroomAbstractTaskTest\createGlobalIlLanguageMock(), ilChatroomAbstractTaskTest\createGlobalRbacSystemMock(), ilChatroomAbstractTaskTest\createIlObjChatroomGUIMock(), and ilChatroomAbstractTaskTest\createIlObjChatroomMock().

18  {
19  parent::setUp();
20 
21  if (!defined('DB_FETCHMODE_OBJECT')) {
22  define('DB_FETCHMODE_OBJECT', 'ASSOC');
23  }
24 
25  require_once './Modules/Chatroom/classes/gui/class.ilChatroomInfoGUI.php';
26 
27  $this->createGlobalIlCtrlMock();
30  $this->createGlobalIlDBMock();
31  $this->createIlObjChatroomMock(15);
32  $this->createIlObjChatroomGUIMock($this->object);
33 
34  $this->task = $this->createMock(
35  'ilChatroomInfoGUI',
36  array('sendResponse', 'getRoomByObjectId', 'redirectIfNoPermission', 'createInfoScreenGUI'),
37  array($this->gui)
38  );
39  }
+ Here is the call graph for this function:

◆ testExecuteDefault()

ilChatroomInfoTaskTest::testExecuteDefault ( )

Definition at line 41 of file class.ilChatroomInfoTaskTest.php.

References $_GET, $GLOBALS, and ilChatroomAbstractTaskTest\createGlobalRbacSystemCheckAccessMock().

42  {
43  $_GET['ref_id'] = 99; // if not set causes error of undefined index
44 
45  require_once './Services/InfoScreen/classes/class.ilInfoScreenGUI.php';
46  $infoScreenMock = $this->createMock('ilInfoScreenGUI', array('addMetaDataSections'), array($this->gui));
47  $infoScreenMock->expects($this->any())->method('addMetaDataSections')->with(
48  $this->equalTo(15),
49  0,
50  null
51  );
52 
53  $this->task->expects($this->any())->method('redirectIfNoPermission')->with(
54  $this->equalTo('view')
55  );
56  $this->task->expects($this->any())->method('getRoomByObjectId')->will(
57  $this->returnValue($this->ilChatroomMock)
58  );
59  $this->task->expects($this->any())->method('createInfoScreenGUI')->will(
60  $this->returnValue($infoScreenMock)
61  );
62  $GLOBALS['ilCtrl']->expects($this->atLeastOnce())->method('forwardCommand');
63 
64  $this->createGlobalRbacSystemCheckAccessMock('visible', true, $this->at(0)); // Suppress raiseError
65  $this->createGlobalRbacSystemCheckAccessMock('read', true, $this->at(1)); // Enables News
66  $this->task->executeDefault(null);
67 
68  $this->createGlobalRbacSystemCheckAccessMock('visible', true, $this->at(0)); // raiseError
69  $this->createGlobalRbacSystemCheckAccessMock('read', true, $this->at(1)); // Enables News
70  $this->task->executeDefault('method');
71  }
$_GET["client_id"]
createGlobalRbacSystemCheckAccessMock($permission, $result, $times=null)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

Field Documentation

◆ $task

ilChatroomInfoTaskTest::$task
protected

Definition at line 15 of file class.ilChatroomInfoTaskTest.php.


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