ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilChatroomAbstractTest.php
Go to the documentation of this file.
1 <?php
2 
8 {
9 
13  protected $ilChatroomMock;
18 
19  protected function setUp()
20  {
21  if (defined('ILIAS_PHPUNIT_CONTEXT')) {
22  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
23  ilUnitUtil::performInitialisation();
24  } else {
25  chdir(dirname(__FILE__));
26  chdir('../../../');
27  }
28  }
29 
30  protected function createIlChatroomMock()
31  {
32  require_once './Modules/Chatroom/classes/class.ilChatroom.php';
33  require_once './Services/Utilities/classes/class.ilUtil.php';
34 
35  $this->ilChatroomMock = $this->getMockBuilder('ilChatroom')->disableOriginalConstructor()->setMethods(
36  array('isOwnerOfPrivateRoom', 'clearMessages')
37  )->getMock();
38 
39  return $this->ilChatroomMock;
40  }
41 
42  protected function createIlChatroomUserMock()
43  {
44  require_once './Modules/Chatroom/classes/class.ilChatroomUser.php';
45 
46  $this->ilChatroomUserMock = $this->getMockBuilder('ilChatroomUser')->disableOriginalConstructor()->setMethods(
47  array('getUserId', 'getUsername')
48  )->getMock();
49 
51  }
52 
53  protected function createGlobalIlDBMock()
54  {
55  $GLOBALS['ilDB'] = $this->getMockBuilder('ilDBMySQL')->disableOriginalConstructor()->setMethods(
56  array('quote', 'query', 'fetchAssoc')
57  )->getMock();
58 
59  return $GLOBALS['ilDB'];
60  }
61 }
Class ilChatroomAbstractTest.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27