19 declare(strict_types=1);
27 $this->ilChatroomUserMock->expects($this->once())->method(
'getUserId')->willReturn(6);
28 $this->ilChatroomUserMock->expects($this->once())->method(
'getUsername')->willReturn(
'username');
30 $userInfo = $this->
object->getPersonalInformation($this->ilChatroomUserMock);
32 $this->assertInstanceOf(stdClass::class, $userInfo);
33 $this->assertSame(
'username', $userInfo->username);
34 $this->assertSame(6, $userInfo->id);
41 $db->expects($this->once())->method(
'fetchAssoc')->willReturn([
'object_id' =>
'6']);
43 $this->assertSame(6, $this->object::_getPublicObjId());
50 $db->expects($this->once())->method(
'fetchAssoc')->willReturn(
null);
52 $this->assertSame(0, $this->object::_getPublicObjId());
55 protected function setUp(): void
61 $this->
object = (
new ReflectionClass(ilObjChatroom::class))->newInstanceWithoutConstructor();
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
createIlChatroomUserMock()
testPublicRoomObjIdDefaultValueCanBeRetrieved()
testPublicRoomObjIdCanBeRetrieved()
testPersonalInformationCanBeRetrieved()