ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Exercise\Certificate\ilExercisePlaceholderDescriptionTest Class Reference
+ Inheritance diagram for ILIAS\Exercise\Certificate\ilExercisePlaceholderDescriptionTest:
+ Collaboration diagram for ILIAS\Exercise\Certificate\ilExercisePlaceholderDescriptionTest:

Public Member Functions

 testPlaceholderGetHtmlDescription ()
 
 testPlaceholderDescriptions ()
 

Detailed Description

Member Function Documentation

◆ testPlaceholderDescriptions()

ILIAS\Exercise\Certificate\ilExercisePlaceholderDescriptionTest::testPlaceholderDescriptions ( )

Definition at line 64 of file ilExercisePlaceholderDescriptionTest.php.

References null.

64  : void
65  {
66  $languageMock = $this->getMockBuilder(ilLanguage::class)
67  ->disableOriginalConstructor()
68  ->onlyMethods(['txt', 'loadLanguageModule'])
69  ->getMock();
70 
71  $languageMock->expects($this->exactly(22))
72  ->method('txt')
73  ->willReturn('Something translated');
74 
75  $userDefinePlaceholderMock = $this->getMockBuilder(ilUserDefinedFieldsPlaceholderDescription::class)
76  ->disableOriginalConstructor()
77  ->getMock();
78 
79  $userDefinePlaceholderMock->method('createPlaceholderHtmlDescription')
80  ->willReturn('');
81 
82  $userDefinePlaceholderMock->method('getPlaceholderDescriptions')
83  ->willReturn([]);
84 
85  $placeholderDescriptionObject = new ExercisePlaceholderDescription(null, $languageMock, $userDefinePlaceholderMock);
86 
87  $placeHolders = $placeholderDescriptionObject->getPlaceholderDescriptions();
88 
89  $this->assertSame(
90  [
91  'CERTIFICATE_ID' => 'Something translated',
92  'USER_LOGIN' => 'Something translated',
93  'USER_FULLNAME' => 'Something translated',
94  'USER_FIRSTNAME' => 'Something translated',
95  'USER_LASTNAME' => 'Something translated',
96  'USER_TITLE' => 'Something translated',
97  'USER_SALUTATION' => 'Something translated',
98  'USER_BIRTHDAY' => 'Something translated',
99  'USER_INSTITUTION' => 'Something translated',
100  'USER_DEPARTMENT' => 'Something translated',
101  'USER_STREET' => 'Something translated',
102  'USER_CITY' => 'Something translated',
103  'USER_ZIPCODE' => 'Something translated',
104  'USER_COUNTRY' => 'Something translated',
105  'USER_MATRICULATION' => 'Something translated',
106  'DATE' => 'Something translated',
107  'DATETIME' => 'Something translated',
108  'RESULT_PASSED' => 'Something translated',
109  'RESULT_MARK' => 'Something translated',
110  'EXERCISE_TITLE' => 'Something translated',
111  'DATE_COMPLETED' => 'Something translated',
112  'DATETIME_COMPLETED' => 'Something translated'
113  ],
114  $placeHolders
115  );
116  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testPlaceholderGetHtmlDescription()

ILIAS\Exercise\Certificate\ilExercisePlaceholderDescriptionTest::testPlaceholderGetHtmlDescription ( )

Definition at line 33 of file ilExercisePlaceholderDescriptionTest.php.

References null.

33  : void
34  {
35  $languageMock = $this->getMockBuilder(ilLanguage::class)
36  ->disableOriginalConstructor()
37  ->onlyMethods(['txt', 'loadLanguageModule'])
38  ->getMock();
39 
40  $templateMock = $this->getMockBuilder(ilTemplate::class)
41  ->disableOriginalConstructor()
42  ->getMock();
43 
44  $userDefinePlaceholderMock = $this->getMockBuilder(ilUserDefinedFieldsPlaceholderDescription::class)
45  ->disableOriginalConstructor()
46  ->getMock();
47 
48  $userDefinePlaceholderMock->method('createPlaceholderHtmlDescription')
49  ->willReturn('');
50 
51  $userDefinePlaceholderMock->method('getPlaceholderDescriptions')
52  ->willReturn([]);
53 
54  $templateMock->method('get')
55  ->willReturn('');
56 
57  $placeholderDescriptionObject = new ExercisePlaceholderDescription(null, $languageMock, $userDefinePlaceholderMock);
58 
59  $html = $placeholderDescriptionObject->createPlaceholderHtmlDescription($templateMock);
60 
61  $this->assertSame('', $html);
62  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

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