ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAwarenessUserProviderContactRequestsTest Class Reference
+ Inheritance diagram for ilAwarenessUserProviderContactRequestsTest:
+ Collaboration diagram for ilAwarenessUserProviderContactRequestsTest:

Public Member Functions

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

Private Member Functions

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

Private Attributes

 $user
 
 $language
 

Additional Inherited Members

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

Detailed Description

Member Function Documentation

◆ create()

ilAwarenessUserProviderContactRequestsTest::create ( )
private

Definition at line 83 of file ilAwarenessUserProviderContactRequestsTest.php.

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

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

83  : Contacts
84  {
85  $this->user = $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock();
86  $this->language = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock();
87 
88  $container = $this->getMockBuilder(Container::class)->disableOriginalConstructor()->getMock();
89  $container->expects(self::once())->method('user')->willReturn($this->user);
90  $container->expects(self::once())->method('language')->willReturn($this->language);
91 
92  return new Contacts($container);
93  }
$container
Definition: wac.php:14
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expectTranslation()

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

Definition at line 71 of file ilAwarenessUserProviderContactRequestsTest.php.

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

Referenced by testGetInfo(), and testGetTitle().

71  : void
72  {
73  $expected = 'translated: ' . $languageKey;
74 
75  $instance = $this->create();
76 
77  $this->language->expects(self::once())->method('loadLanguageModule')->with('contact');
78  $this->language->expects(self::once())->method('txt')->with($languageKey)->willReturn($expected);
79 
80  $this->assertSame($expected, $instance->$method());
81  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testConstruct()

ilAwarenessUserProviderContactRequestsTest::testConstruct ( )

Definition at line 37 of file ilAwarenessUserProviderContactRequestsTest.php.

References create().

37  : void
38  {
39  $this->assertInstanceOf(Contacts::class, $this->create());
40  }
+ Here is the call graph for this function:

◆ testGetInfo()

ilAwarenessUserProviderContactRequestsTest::testGetInfo ( )

Definition at line 52 of file ilAwarenessUserProviderContactRequestsTest.php.

References expectTranslation().

52  : void
53  {
54  $this->expectTranslation('getInfo', 'contact_awrn_req_contacts_info');
55  }
+ Here is the call graph for this function:

◆ testGetInitialUserSet()

ilAwarenessUserProviderContactRequestsTest::testGetInitialUserSet ( )

Definition at line 57 of file ilAwarenessUserProviderContactRequestsTest.php.

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

57  : void
58  {
59  $instance = $this->create();
60 
61  $this->user->expects(self::once())->method('isAnonymous')->willReturn(true);
62 
63  $this->assertEquals([], $instance->getInitialUserSet());
64  }
+ Here is the call graph for this function:

◆ testGetProviderId()

ilAwarenessUserProviderContactRequestsTest::testGetProviderId ( )

Definition at line 42 of file ilAwarenessUserProviderContactRequestsTest.php.

References create().

42  : void
43  {
44  $this->assertSame('contact_approved', $this->create()->getProviderId());
45  }
+ Here is the call graph for this function:

◆ testGetTitle()

ilAwarenessUserProviderContactRequestsTest::testGetTitle ( )

Definition at line 47 of file ilAwarenessUserProviderContactRequestsTest.php.

References expectTranslation().

47  : void
48  {
49  $this->expectTranslation('getTitle', 'contact_awrn_req_contacts');
50  }
+ Here is the call graph for this function:

◆ testIsHighlighted()

ilAwarenessUserProviderContactRequestsTest::testIsHighlighted ( )

Definition at line 66 of file ilAwarenessUserProviderContactRequestsTest.php.

References create().

66  : void
67  {
68  $this->assertTrue($this->create()->isHighlighted());
69  }
+ Here is the call graph for this function:

Field Documentation

◆ $language

ilAwarenessUserProviderContactRequestsTest::$language
private

◆ $user

ilAwarenessUserProviderContactRequestsTest::$user
private

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