3require_once 
'class.ilChatroomAbstractTest.php';
 
   21        require_once 
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
 
   25        $this->
object = $this->createMock(
 
   27            array(
'createDefaultRole')
 
   33        $this->assertInstanceOf(
'ilObjChatroom', $this->
object);
 
   38        $this->ilChatroomUserMock->expects($this->
once())->method(
'getUserId')->will($this->returnValue(6));
 
   39        $this->ilChatroomUserMock->expects($this->
once())->method(
'getUsername')->will($this->returnValue(
'username'));
 
   41        $userInfo = $this->
object->getPersonalInformation($this->ilChatroomUserMock);
 
   43        $this->assertInstanceOf(
'stdClass', $userInfo);
 
   44        $this->assertEquals(
'username', $userInfo->username);
 
   45        $this->assertEquals(6, $userInfo->id);
 
   50        $this->assertEquals(0, $this->object->_getPublicRefId());
 
   57        $query = 
'SELECT object_id FROM chatroom_settings WHERE room_type=default';
 
   58        $GLOBALS[
'ilDB']->expects($this->
once())->method(
'query')->with($this->equalTo(
$query));
 
   59        $GLOBALS[
'ilDB']->expects($this->
once())->method(
'quote')->with($this->equalTo(
'default'))->will($this->returnValue(
'default'));
 
   60        $GLOBALS[
'ilDB']->expects($this->
once())->method(
'fetchAssoc')->will($this->returnValue(array(
'object_id' => 
'6')));
 
   62        $this->assertEquals(6, $this->object->_getPublicObjId());
 
   69        $query = 
'SELECT object_id FROM chatroom_settings WHERE room_type=default';
 
   70        $GLOBALS[
'ilDB']->expects($this->
once())->method(
'query')->with($this->equalTo(
$query));
 
   71        $GLOBALS[
'ilDB']->expects($this->
once())->method(
'quote')->with($this->equalTo(
'default'))->will($this->returnValue(
'default'));
 
   72        $GLOBALS[
'ilDB']->expects($this->
once())->method(
'fetchAssoc')->will($this->returnValue(
null));
 
   74        $this->assertEquals(0, $this->object->_getPublicObjId());
 
   80        $this->backupStaticAttributes = 
true;
 
   81        $this->
object->expects($this->
once())->method(
'createDefaultRole');
 
   82        $this->assertEmpty($this->object->initDefaultRoles());
 
An exception for terminatinating execution or to throw for unit testing.
Class ilChatroomAbstractTest.
createIlChatroomUserMock()
test_GetPublicObjIdDefaultValue()
testGetPersonalInformation()
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.