3 require_once dirname(__FILE__) .
'/../class.ilChatroomAbstractTaskTest.php';
21 require_once
'./Modules/Chatroom/classes/gui/class.ilChatroomClearGUI.php';
22 require_once
'./Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
30 $this->createilChatroomMock();
37 $this->task = $this->getMock(
39 array(
'sendResponse',
'getRoomByObjectId',
'redirectIfNoPermission'),
48 $this->task->expects($this->once())->method(
'redirectIfNoPermission')->with(
49 $this->equalTo(
'moderate')
51 $this->task->expects($this->any())->method(
'getRoomByObjectId')->will(
52 $this->returnValue($this->ilChatroomMock)
58 $this->setExpectedException(
'Exception',
'Exit', 0);
59 $this->task->executeDefault(null);
66 $this->task->expects($this->once())->method(
'redirectIfNoPermission')->with(
'moderate')->will($this->returnCallback(
function ()
68 throw new Exception(
'Weak redirect on no Permission. Send just failure message instead', 1456351768);
71 $this->setExpectedException(
'Exception',
"", 1456351768);
72 $this->task->executeDefault(null);
79 $this->task->expects($this->once())->method(
'redirectIfNoPermission')->with(
80 $this->equalTo(
'moderate')
82 $this->task->expects($this->any())->method(
'getRoomByObjectId')->will(
83 $this->returnValue(null)
87 'reason' =>
'unkown room',
90 $this->setExpectedException(
'Exception',
'Exit', 0);
91 $this->task->executeDefault(null);
Class ilChatroomClearTask.
Class ilChatroomAbstractTaskTest.
createIlChatroomServerConnectorMock($settings)
createIlObjChatroomMock($id)
testExecuteDefaultFailedNoRoomExists()
createGlobalRbacSystemMock()
createIlChatroomServerConnectorFileGetContentsMock($returnValue)
Create styles array
The data for the language used.
createIlObjChatroomGUIMock($object)
Class ilChatroomServerSettings.
testExecuteDefaultFailedPermission()
createSendResponseMock($mock, $response)
createGlobalIlLanguageMock()
Class ilChatroomServerConnectorMock.
createIlObjChatroomGUIGetConnectorMock($returnValue)