3 require_once
'class.ilChatroomAbstractTest.php';
35 if (!
defined(
'ROOT_FOLDER_ID')) {
36 define(
'ROOT_FOLDER_ID',
time());
42 require_once
'./Services/Language/classes/class.ilLanguage.php';
43 $GLOBALS[
'lng'] = $this->getMockBuilder(
'ilLanguage')->disableOriginalConstructor()->setMethods(
44 array(
'loadLanguageModule',
'txt')
47 $GLOBALS[
'lng']->expects($this->any())->method(
'loadLanguageModule')->with($this->logicalOr($this->equalTo(
'chatroom'), $this->equalTo(
'meta')));
48 $GLOBALS[
'lng']->expects($this->any())->method(
'txt');
55 require_once
'./Services/AccessControl/classes/class.ilRbacSystem.php';
56 $GLOBALS[
'rbacsystem'] = $this->getMockBuilder(
'ilRbacSystem')->disableOriginalConstructor()->setMethods(
71 $times = $this->any();
74 return $GLOBALS[
'rbacsystem']->expects($times)->method(
'checkAccess')->with($this->equalTo($permission))->will(
81 require_once
'./Services/UICore/classes/class.ilCtrl.php';
83 $GLOBALS[
'ilCtrl'] = $this->getMockBuilder(
'ilCtrl')->disableOriginalConstructor()->setMethods(
84 array(
'setParameterByClass',
'redirectByClass',
'forwardCommand')
86 $GLOBALS[
'ilCtrl']->expects($this->any())->method(
'setParameterByClass');
87 $GLOBALS[
'ilCtrl']->expects($this->any())->method(
'redirectByClass');
94 require_once
'Services/User/classes/class.ilObjUser.php';
96 $GLOBALS[
'ilUser'] = $this->getMockBuilder(
'ilObjUser')->disableOriginalConstructor()->setMethods(
105 require_once
'./Modules/Chatroom/classes/class.ilObjChatroomGUI.php';
107 $this->gui = $this->getMockBuilder(
'ilObjChatroomGUI')->disableOriginalConstructor()->disableArgumentCloning()->setMethods(
108 array(
'getRefId',
'getConnector',
'switchToVisibleMode')
110 $this->gui->ref_id = self::TEST_REF_ID;
118 $this->gui->expects($this->any())->method(
'getConnector')->will($this->returnValue($returnValue));
129 return $this->ilChatroomMock->expects($this->at(0))->method(
'isOwnerOfPrivateRoom')->with(
130 $this->equalTo($userId),
131 $this->equalTo($subRoomId)
132 )->will($this->returnValue(
$result));
137 return $this->ilChatroomUserMock->expects($this->any())->method(
'getUserId')->will($this->returnValue($userId));
146 require_once
'./Modules/Chatroom/classes/class.ilChatroomServerConnector.php';
150 )->setMethods(
array(
'file_get_contents'))->getMock();
158 $this->returnValue($returnValue)
164 require_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
166 $this->
object = $this->getMockBuilder(
'ilObjChatroom')->disableOriginalConstructor()->setMethods(
169 $this->
object->expects($this->any())->method(
'getId')->will($this->returnValue(
$id));
176 $mock->expects($this->once())->method(
'sendResponse')->with(
179 $this->returnCallback(
createIlChatroomUserGetUserIdMock($userId)
Class ilChatroomAbstractTest.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
if(!array_key_exists('StateId', $_REQUEST)) $id
Class ilChatroomAbstractTaskTest.
createIlChatroomIsOwnerOfPrivateRoomMock($userId, $subRoomId, $result)
createIlChatroomServerConnectorMock($settings)
createIlObjChatroomMock($id)
createGlobalRbacSystemCheckAccessMock($permission, $result, $times=null)
createGlobalRbacSystemMock()
createIlChatroomServerConnectorFileGetContentsMock($returnValue)
Create styles array
The data for the language used.
createIlObjChatroomGUIMock($object)
$ilChatroomServerConnectorMock
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
createSendResponseMock($mock, $response)
createGlobalIlLanguageMock()
Class ilChatroomServerConnectorMock.
createIlObjChatroomGUIGetConnectorMock($returnValue)