3 require_once dirname(__FILE__) .
'/class.ilChatroomAbstractTaskTest.php';
28 require_once
'./Modules/Chatroom/test/mocks/class.ilChatroomTaskHandlerMock.php';
29 $this->handler =
new ilChatroomGUIHandlerMock($this->gui);
34 $this->assertEquals(
'default', $this->handler->executeDefault(
'default'));
39 $this->assertTrue($this->handler->execute(
'testFunc'));
44 $this->assertEquals(
'nonExistingFunc', $this->handler->execute(
'nonExistingFunc'));
49 $response =
array(
'success' =>
true);
50 $this->assertTrue($this->handler->isSuccessful(json_encode($response)));
52 $response =
array(
'success' =>
false);
53 $this->assertFalse($this->handler->isSuccessful(json_encode($response)));
55 $response =
array(
'failed' =>
false);
56 $this->assertFalse($this->handler->isSuccessful(json_encode($response)));
58 $response =
'nonJson';
59 $this->assertFalse($this->handler->isSuccessful($response));
77 $this->assertEquals(
$result, $this->handler->mockedCanModerate($this->ilChatroomMock, $subRoomId, $userId));
83 $this->handler->mockedExitIfNoRoomExists($this->ilChatroomMock);
85 $this->setExpectedException(
90 'reason' =>
'unkown room',
94 $this->handler->mockedExitIfNoRoomExists(null);
108 $this->handler->mockedExitIfNoRoomPermission($this->ilChatroomMock, $subRoomId, $this->ilChatroomUserMock);
122 $this->setExpectedException(
127 'reason' =>
'not owner of private room',
132 $this->handler->mockedExitIfNoRoomPermission($this->ilChatroomMock, $subRoomId, $this->ilChatroomUserMock);
143 $this->handler->redirectIfNoPermission(
'moderate');
144 $this->handler->redirectIfNoPermission(
'user');
153 array(
true,
true,
true),
154 array(
true,
false,
false),
155 array(
false,
true,
false),
testRedirectIfNoPermission()
testExitIfNoRoomPermissionFails()
createIlChatroomUserGetUserIdMock($userId)
createIlChatroomUserMock()
Class ilChatroomAbstractTaskTest.
createIlChatroomIsOwnerOfPrivateRoomMock($userId, $subRoomId, $result)
canModerateDataProvider()
testCanModerate($isOwnerOfPrivateRoomValue, $checkAccessValue, $result)
canModerateDataProvider
createIlObjChatroomMock($id)
createGlobalRbacSystemCheckAccessMock($permission, $result, $times=null)
createGlobalRbacSystemMock()
Class ilChatroomTaskHandlerTest.
testExitIfNoRoomPermissionSuccess()
testExecuteWithMethodExit()
Create styles array
The data for the language used.
createIlObjChatroomGUIMock($object)
testExecuteWithMethodNotExit()
createGlobalIlLanguageMock()