ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 array, ilChatroomAbstractTaskTest\createGlobalIlCtrlMock(), ilChatroomAbstractTest\createGlobalIlDBMock(), ilChatroomAbstractTaskTest\createGlobalIlLanguageMock(), ilChatroomAbstractTaskTest\createGlobalRbacSystemMock(), ilChatroomAbstractTaskTest\createIlObjChatroomGUIMock(), ilChatroomAbstractTaskTest\createIlObjChatroomMock(), and defined.

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

◆ testExecuteDefault()

ilChatroomInfoTaskTest::testExecuteDefault ( )

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

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

43  {
44  $_GET['ref_id'] = 99; // if not set causes error of undefined index
45 
46  require_once './Services/InfoScreen/classes/class.ilInfoScreenGUI.php';
47  $infoScreenMock = $this->getMock('ilInfoScreenGUI', array('addMetaDataSections'), array($this->gui));
48  $infoScreenMock->expects($this->any())->method('addMetaDataSections')->with(
49  $this->equalTo(15), 0, null
50  );
51 
52  $this->task->expects($this->any())->method('redirectIfNoPermission')->with(
53  $this->equalTo('view')
54  );
55  $this->task->expects($this->any())->method('getRoomByObjectId')->will(
56  $this->returnValue($this->ilChatroomMock)
57  );
58  $this->task->expects($this->any())->method('createInfoScreenGUI')->will(
59  $this->returnValue($infoScreenMock)
60  );
61  $GLOBALS['ilCtrl']->expects($this->atLeastOnce())->method('forwardCommand');
62 
63  $this->createGlobalRbacSystemCheckAccessMock('visible', true, $this->at(0)); // Suppress raiseError
64  $this->createGlobalRbacSystemCheckAccessMock('read', true, $this->at(1)); // Enables News
65  $this->task->executeDefault(null);
66 
67  $this->createGlobalRbacSystemCheckAccessMock('visible', true, $this->at(0)); // raiseError
68  $this->createGlobalRbacSystemCheckAccessMock('read', true, $this->at(1)); // Enables News
69  $this->task->executeDefault('method');
70  }
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
createGlobalRbacSystemCheckAccessMock($permission, $result, $times=null)
Create styles array
The data for the language used.
+ 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: