ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
23  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
24  ilUnitUtil::performInitialisation();
25  }
26  else
27  {
28  chdir(dirname(__FILE__));
29  chdir('../../../');
30  }
31  }
32 
33  protected function createIlChatroomMock()
34  {
35  require_once './Modules/Chatroom/classes/class.ilChatroom.php';
36  require_once './Services/Utilities/classes/class.ilUtil.php';
37 
38  $this->ilChatroomMock = $this->getMockBuilder('ilChatroom')->disableOriginalConstructor()->setMethods(
39  array('isOwnerOfPrivateRoom', 'clearMessages')
40  )->getMock();
41 
42  return $this->ilChatroomMock;
43  }
44 
45  protected function createIlChatroomUserMock()
46  {
47  require_once './Modules/Chatroom/classes/class.ilChatroomUser.php';
48 
49  $this->ilChatroomUserMock = $this->getMockBuilder('ilChatroomUser')->disableOriginalConstructor()->setMethods(
50  array('getUserId', 'getUsername')
51  )->getMock();
52 
54  }
55 
56  protected function createGlobalIlDBMock()
57  {
58  $GLOBALS['ilDB'] = $this->getMockBuilder('ilDBMySQL')->disableOriginalConstructor()->setMethods(
59  array('quote', 'query', 'fetchAssoc')
60  )->getMock();
61 
62  return $GLOBALS['ilDB'];
63  }
64 }
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