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->createMock(
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 () {
67 throw new Exception(
'Weak redirect on no Permission. Send just failure message instead', 1456351768);
70 $this->setExpectedException(
'Exception',
"", 1456351768);
71 $this->task->executeDefault(null);
78 $this->task->expects($this->
once())->method(
'redirectIfNoPermission')->with(
79 $this->equalTo(
'moderate')
81 $this->task->expects($this->any())->method(
'getRoomByObjectId')->will(
82 $this->returnValue(null)
86 'reason' =>
'unkown room',
89 $this->setExpectedException(
'Exception',
'Exit', 0);
90 $this->task->executeDefault(null);
Class ilChatroomClearTask.
Class ilChatroomAbstractTaskTest.
createIlChatroomServerConnectorMock($settings)
createIlObjChatroomMock($id)
testExecuteDefaultFailedNoRoomExists()
createGlobalRbacSystemMock()
createIlChatroomServerConnectorFileGetContentsMock($returnValue)
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
createIlObjChatroomGUIMock($object)
Class ilChatroomServerSettings.
testExecuteDefaultFailedPermission()
createSendResponseMock($mock, $response)
createGlobalIlLanguageMock()
Class ilChatroomServerConnectorMock.
createIlObjChatroomGUIGetConnectorMock($returnValue)