ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAwarenessUserProviderContactRequestsTestCase Class Reference
+ Inheritance diagram for ilAwarenessUserProviderContactRequestsTestCase:
+ Collaboration diagram for ilAwarenessUserProviderContactRequestsTestCase:

Public Member Functions

 testConstruct ()
 
 testGetProviderId ()
 
 testGetTitle ()
 
 testGetInfo ()
 
 testGetInitialUserSet ()
 
 testIsHighlighted ()
 

Private Member Functions

 expectTranslation (string $method, string $languageKey)
 
 create ()
 

Private Attributes

ilObjUser MockObject $user
 
ilLanguage MockObject $language
 

Additional Inherited Members

- Protected Member Functions inherited from ilBuddySystemBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, mixed $value)
 

Detailed Description

Member Function Documentation

◆ create()

ilAwarenessUserProviderContactRequestsTestCase::create ( )
private

Definition at line 76 of file ilAwarenessUserProviderContactRequestsTestCase.php.

76 : Contacts
77 {
78 $this->user = $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock();
79 $this->language = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock();
80
81 $container = $this->getMockBuilder(Container::class)->disableOriginalConstructor()->getMock();
82 $container->expects($this->once())->method('user')->willReturn($this->user);
83 $container->expects($this->once())->method('language')->willReturn($this->language);
84
85 return new Contacts($container);
86 }
$container
@noRector
Definition: wac.php:37

References $container, ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Repository\user().

Referenced by expectTranslation(), testConstruct(), testGetInitialUserSet(), testGetProviderId(), and testIsHighlighted().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expectTranslation()

ilAwarenessUserProviderContactRequestsTestCase::expectTranslation ( string  $method,
string  $languageKey 
)
private

Definition at line 64 of file ilAwarenessUserProviderContactRequestsTestCase.php.

64 : void
65 {
66 $expected = 'translated: ' . $languageKey;
67
68 $instance = $this->create();
69
70 $this->language->expects($this->once())->method('loadLanguageModule')->with('contact');
71 $this->language->expects($this->once())->method('txt')->with($languageKey)->willReturn($expected);
72
73 $this->assertSame($expected, $instance->$method());
74 }

References create(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by testGetInfo(), and testGetTitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testConstruct()

ilAwarenessUserProviderContactRequestsTestCase::testConstruct ( )

Definition at line 30 of file ilAwarenessUserProviderContactRequestsTestCase.php.

30 : void
31 {
32 $this->assertInstanceOf(Contacts::class, $this->create());
33 }

References create().

+ Here is the call graph for this function:

◆ testGetInfo()

ilAwarenessUserProviderContactRequestsTestCase::testGetInfo ( )

Definition at line 45 of file ilAwarenessUserProviderContactRequestsTestCase.php.

45 : void
46 {
47 $this->expectTranslation('getInfo', 'contact_awrn_req_contacts_info');
48 }

References expectTranslation().

+ Here is the call graph for this function:

◆ testGetInitialUserSet()

ilAwarenessUserProviderContactRequestsTestCase::testGetInitialUserSet ( )

Definition at line 50 of file ilAwarenessUserProviderContactRequestsTestCase.php.

50 : void
51 {
52 $instance = $this->create();
53
54 $this->user->expects($this->once())->method('isAnonymous')->willReturn(true);
55
56 $this->assertEquals([], $instance->getInitialUserSet());
57 }

References create(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ testGetProviderId()

ilAwarenessUserProviderContactRequestsTestCase::testGetProviderId ( )

Definition at line 35 of file ilAwarenessUserProviderContactRequestsTestCase.php.

35 : void
36 {
37 $this->assertSame('contact_approved', $this->create()->getProviderId());
38 }

References create().

+ Here is the call graph for this function:

◆ testGetTitle()

ilAwarenessUserProviderContactRequestsTestCase::testGetTitle ( )

Definition at line 40 of file ilAwarenessUserProviderContactRequestsTestCase.php.

40 : void
41 {
42 $this->expectTranslation('getTitle', 'contact_awrn_req_contacts');
43 }

References expectTranslation().

+ Here is the call graph for this function:

◆ testIsHighlighted()

ilAwarenessUserProviderContactRequestsTestCase::testIsHighlighted ( )

Definition at line 59 of file ilAwarenessUserProviderContactRequestsTestCase.php.

59 : void
60 {
61 $this->assertTrue($this->create()->isHighlighted());
62 }

References create().

+ Here is the call graph for this function:

Field Documentation

◆ $language

ilLanguage MockObject ilAwarenessUserProviderContactRequestsTestCase::$language
private

◆ $user

ilObjUser MockObject ilAwarenessUserProviderContactRequestsTestCase::$user
private

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