3require_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')
 
  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(
 
  181                    throw new Exception(
'Exit', 0);
 
An exception for terminatinating execution or to throw for unit testing.
Class ilChatroomAbstractTaskTest.
createIlChatroomIsOwnerOfPrivateRoomMock($userId, $subRoomId, $result)
createSendResponseMock($mock, $response)
createIlChatroomUserGetUserIdMock($userId)
createIlObjChatroomGUIMock($object)
createIlObjChatroomMock($id)
createIlObjChatroomGUIGetConnectorMock($returnValue)
$ilChatroomServerConnectorMock
createGlobalRbacSystemMock()
createGlobalRbacSystemCheckAccessMock($permission, $result, $times=null)
createGlobalIlLanguageMock()
createIlChatroomServerConnectorMock($settings)
createIlChatroomServerConnectorFileGetContentsMock($returnValue)
Class ilChatroomAbstractTest.
Class ilChatroomServerConnectorMock.
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.