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

Public Member Functions

 testConstruct ()
 
 testGetProviderId (ApprovedContacts $instance)
 
 testGetTitle ()
 
 testGetInfo ()
 
 testGetInitialUserSet ()
 
 testIsHighlighted (ApprovedContacts $instance)
 

Private Member Functions

 expectTranslation (string $method, string $languageKey)
 

Additional Inherited Members

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

Detailed Description

Member Function Documentation

◆ expectTranslation()

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

Definition at line 78 of file ilAwarenessUserProviderApprovedContactsTestCase.php.

78 : void
79 {
80 $expected = 'translated: ' . $languageKey;
81 $user = $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock();
82
83 $language = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock();
84 $language->expects($this->once())->method('loadLanguageModule')->with('contact');
85 $language->expects($this->once())->method('txt')->with($languageKey)->willReturn($expected);
86
87 $container = $this->getMockBuilder(Container::class)->disableOriginalConstructor()->getMock();
88 $container->expects($this->once())->method('user')->willReturn($user);
89 $container->expects($this->once())->method('language')->willReturn($language);
90
91 $instance = new ApprovedContacts($container);
92 $this->assertSame($expected, $instance->$method());
93 }
$container
@noRector
Definition: wac.php:37

References $container.

Referenced by testGetInfo(), and testGetTitle().

+ Here is the caller graph for this function:

◆ testConstruct()

ilAwarenessUserProviderApprovedContactsTestCase::testConstruct ( )

Definition at line 27 of file ilAwarenessUserProviderApprovedContactsTestCase.php.

27 : ApprovedContacts
28 {
29 $user = $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock();
30 $language = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock();
31 $container = $this->getMockBuilder(Container::class)->disableOriginalConstructor()->getMock();
32 $container->expects($this->once())->method('user')->willReturn($user);
33 $container->expects($this->once())->method('language')->willReturn($language);
34
35 $instance = new ApprovedContacts($container);
36
37 $this->assertInstanceOf(ApprovedContacts::class, $instance);
38
39 return $instance;
40 }

References $container.

◆ testGetInfo()

ilAwarenessUserProviderApprovedContactsTestCase::testGetInfo ( )

Definition at line 53 of file ilAwarenessUserProviderApprovedContactsTestCase.php.

53 : void
54 {
55 $this->expectTranslation('getInfo', 'contact_awrn_ap_contacts_info');
56 }

References expectTranslation().

+ Here is the call graph for this function:

◆ testGetInitialUserSet()

ilAwarenessUserProviderApprovedContactsTestCase::testGetInitialUserSet ( )

Definition at line 58 of file ilAwarenessUserProviderApprovedContactsTestCase.php.

58 : void
59 {
60 $user = $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock();
61 $user->expects($this->once())->method('isAnonymous')->willReturn(true);
62 $language = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock();
63 $container = $this->getMockBuilder(Container::class)->disableOriginalConstructor()->getMock();
64 $container->expects($this->once())->method('user')->willReturn($user);
65 $container->expects($this->once())->method('language')->willReturn($language);
66
67 $instance = new ApprovedContacts($container);
68
69 $this->assertEquals([], $instance->getInitialUserSet());
70 }

References $container.

◆ testGetProviderId()

ilAwarenessUserProviderApprovedContactsTestCase::testGetProviderId ( ApprovedContacts  $instance)

Definition at line 43 of file ilAwarenessUserProviderApprovedContactsTestCase.php.

43 : void
44 {
45 $this->assertSame('contact_requests', $instance->getProviderId());
46 }

◆ testGetTitle()

ilAwarenessUserProviderApprovedContactsTestCase::testGetTitle ( )

Definition at line 48 of file ilAwarenessUserProviderApprovedContactsTestCase.php.

48 : void
49 {
50 $this->expectTranslation('getTitle', 'contact_awrn_ap_contacts');
51 }

References expectTranslation().

+ Here is the call graph for this function:

◆ testIsHighlighted()

ilAwarenessUserProviderApprovedContactsTestCase::testIsHighlighted ( ApprovedContacts  $instance)

Definition at line 73 of file ilAwarenessUserProviderApprovedContactsTestCase.php.

73 : void
74 {
75 $this->assertFalse($instance->isHighlighted());
76 }

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