19 declare(strict_types=1);
31 protected function setUp(): void
35 if (!defined(
'ROOT_FOLDER_ID')) {
36 define(
'ROOT_FOLDER_ID', time());
42 $lng = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->onlyMethods(
43 [
'loadLanguageModule',
'txt']
46 $lng->method(
'loadLanguageModule')->with(
48 $this->equalTo(
'chatroom'),
49 $this->equalTo(
'meta')
61 $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->onlyMethods(
73 ?InvocationOrder $times =
null 75 if ($times ===
null) {
76 $times = $this->any();
79 return $GLOBALS[
'rbacsystem']->expects($times)
80 ->method(
'checkAccess')
81 ->with($this->equalTo($permission))->willReturn(
88 $ctrl = $this->createMock(ilCtrlInterface::class);
97 $user = $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock();
106 $this->gui->method(
'getConnector')->willReturn($returnValue);
113 ): InvocationMocker {
114 return $this->ilChatroomMock->method(
'isOwnerOfPrivateRoom')->with(
115 $this->equalTo($userId),
116 $this->equalTo($subRoomId)
117 )->willReturn($result);
122 return $this->ilChatroomUserMock->method(
'getUserId')->willReturn($userId);
128 $this->ilChatroomServerConnectorMock = $this->getMockBuilder(ilChatroomServerConnector::class)->setConstructorArgs(
130 )->onlyMethods([
'file_get_contents'])->getMock();
137 return $this->ilChatroomServerConnectorMock->method(
'file_get_contents')->willReturn(
144 $this->
object = $this->getMockBuilder(ilObjChatroom::class)->disableOriginalConstructor()->onlyMethods(
147 $this->
object->method(
'getId')->willReturn($id);
154 $mock->expects($this->once())->method(
'sendResponse')->with(
156 )->willReturnCallback(
157 static function (): never {
MockObject &ilObjChatroom $object
createIlObjChatroomGUIGetConnectorMock($returnValue)
createIlObjChatroomMock(int $id)
createIlChatroomServerConnectorMock(ilChatroomServerSettings $settings)
createGlobalRbacSystemCheckAccessMock(string $permission, bool $result, ?InvocationOrder $times=null)
MockObject &ilChatroomServerConnector $ilChatroomServerConnectorMock
createSendResponseMock(MockObject $mock, $response)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
createGlobalRbacSystemMock()
Class ilChatroomServerConnector.
createIlChatroomUserGetUserIdMock(int $userId)
MockObject &ilChatroomObjectGUI $gui
createIlChatroomIsOwnerOfPrivateRoomMock(int $userId, int $subRoomId, bool $result)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
createGlobalIlLanguageMock()
setGlobalVariable(string $name, $value)
createIlChatroomServerConnectorFileGetContentsMock($returnValue)