ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjChatroomTest Class Reference

Class ilObjChatroomTest. More...

+ Inheritance diagram for ilObjChatroomTest:
+ Collaboration diagram for ilObjChatroomTest:

Public Member Functions

 testPersonalInformationCanBeRetrieved ()
 
 testPublicRoomObjIdCanBeRetrieved ()
 
 testPublicRoomObjIdDefaultValueCanBeRetrieved ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilChatroomAbstractTest
 setUp ()
 
 tearDown ()
 
 createIlChatroomMock ()
 
 createIlChatroomUserMock ()
 
 createGlobalIlDBMock ()
 
 setGlobalVariable (string $name, $value)
 

Protected Attributes

ilObjChatroom $object
 
- Protected Attributes inherited from ilChatroomAbstractTest
 $ilChatroomMock
 
 $ilChatroomUserMock
 

Detailed Description

Class ilObjChatroomTest.

Author
Thomas Joußen tjous.nosp@m.sen@.nosp@m.gmx.d.nosp@m.e

Definition at line 25 of file class.ilObjChatroomTest.php.

Member Function Documentation

◆ setUp()

ilObjChatroomTest::setUp ( )
protected

Definition at line 59 of file class.ilObjChatroomTest.php.

References ilChatroomAbstractTest\createIlChatroomUserMock().

59  : void
60  {
61  parent::setUp();
62 
63  $this->createIlChatroomUserMock();
64 
65  $this->object = (new ReflectionClass(ilObjChatroom::class))->newInstanceWithoutConstructor();
66  }
+ Here is the call graph for this function:

◆ testPersonalInformationCanBeRetrieved()

ilObjChatroomTest::testPersonalInformationCanBeRetrieved ( )

Definition at line 29 of file class.ilObjChatroomTest.php.

29  : void
30  {
31  $this->ilChatroomUserMock->expects($this->once())->method('getUserId')->willReturn(6);
32  $this->ilChatroomUserMock->expects($this->once())->method('getUsername')->willReturn('username');
33 
34  $userInfo = $this->object->getPersonalInformation($this->ilChatroomUserMock);
35 
36  $this->assertInstanceOf(stdClass::class, $userInfo);
37  $this->assertSame('username', $userInfo->username);
38  $this->assertSame(6, $userInfo->id);
39  }

◆ testPublicRoomObjIdCanBeRetrieved()

ilObjChatroomTest::testPublicRoomObjIdCanBeRetrieved ( )

Definition at line 41 of file class.ilObjChatroomTest.php.

References ilChatroomAbstractTest\createGlobalIlDBMock().

41  : void
42  {
43  $db = $this->createGlobalIlDBMock();
44 
45  $db->expects($this->once())->method('fetchAssoc')->willReturn(['object_id' => '6']);
46 
47  $this->assertSame(6, $this->object::_getPublicObjId());
48  }
+ Here is the call graph for this function:

◆ testPublicRoomObjIdDefaultValueCanBeRetrieved()

ilObjChatroomTest::testPublicRoomObjIdDefaultValueCanBeRetrieved ( )

Definition at line 50 of file class.ilObjChatroomTest.php.

References ilChatroomAbstractTest\createGlobalIlDBMock().

50  : void
51  {
52  $db = $this->createGlobalIlDBMock();
53 
54  $db->expects($this->once())->method('fetchAssoc')->willReturn(null);
55 
56  $this->assertSame(0, $this->object::_getPublicObjId());
57  }
+ Here is the call graph for this function:

Field Documentation

◆ $object

ilObjChatroom ilObjChatroomTest::$object
protected

Definition at line 27 of file class.ilObjChatroomTest.php.


The documentation for this class was generated from the following file: