ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

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

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
Definition: wac.php:36
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ 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.

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

Referenced by testGetInfo(), and testGetTitle().

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  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ 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.

References create().

30  : void
31  {
32  $this->assertInstanceOf(Contacts::class, $this->create());
33  }
+ Here is the call graph for this function:

◆ testGetInfo()

ilAwarenessUserProviderContactRequestsTestCase::testGetInfo ( )

Definition at line 45 of file ilAwarenessUserProviderContactRequestsTestCase.php.

References expectTranslation().

45  : void
46  {
47  $this->expectTranslation('getInfo', 'contact_awrn_req_contacts_info');
48  }
+ Here is the call graph for this function:

◆ testGetInitialUserSet()

ilAwarenessUserProviderContactRequestsTestCase::testGetInitialUserSet ( )

Definition at line 50 of file ilAwarenessUserProviderContactRequestsTestCase.php.

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

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  }
+ Here is the call graph for this function:

◆ testGetProviderId()

ilAwarenessUserProviderContactRequestsTestCase::testGetProviderId ( )

Definition at line 35 of file ilAwarenessUserProviderContactRequestsTestCase.php.

References create().

35  : void
36  {
37  $this->assertSame('contact_approved', $this->create()->getProviderId());
38  }
+ Here is the call graph for this function:

◆ testGetTitle()

ilAwarenessUserProviderContactRequestsTestCase::testGetTitle ( )

Definition at line 40 of file ilAwarenessUserProviderContactRequestsTestCase.php.

References expectTranslation().

40  : void
41  {
42  $this->expectTranslation('getTitle', 'contact_awrn_req_contacts');
43  }
+ Here is the call graph for this function:

◆ testIsHighlighted()

ilAwarenessUserProviderContactRequestsTestCase::testIsHighlighted ( )

Definition at line 59 of file ilAwarenessUserProviderContactRequestsTestCase.php.

References create().

59  : void
60  {
61  $this->assertTrue($this->create()->isHighlighted());
62  }
+ 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: