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

Reimplemented from ilChatroomAbstractTaskTest.

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

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
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 }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

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

+ Here is the call graph for this function:

◆ testExecuteDefault()

ilChatroomInfoTaskTest::testExecuteDefault ( )

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

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"]
createGlobalRbacSystemCheckAccessMock($permission, $result, $times=null)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

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

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