ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilScormPlaceholderDescriptionTest Class Reference
+ Inheritance diagram for ilScormPlaceholderDescriptionTest:
+ Collaboration diagram for ilScormPlaceholderDescriptionTest:

Public Member Functions

 testPlaceholderGetHtmlDescription ()
 
 testPlaceholderDescriptions ()
 

Detailed Description

Definition at line 23 of file ilScormPlaceholderDescriptionTest.php.

Member Function Documentation

◆ testPlaceholderDescriptions()

ilScormPlaceholderDescriptionTest::testPlaceholderDescriptions ( )

Definition at line 82 of file ilScormPlaceholderDescriptionTest.php.

References null.

82  : void
83  {
84  $objectMock = $this->getMockBuilder(ilObject::class)
85  ->disableOriginalConstructor()
86  ->onlyMethods([])
87  ->getMock();
88 
89  $languageMock = $this->getMockBuilder(ilLanguage::class)
90  ->disableOriginalConstructor()
91  ->onlyMethods(['txt', 'loadLanguageModule'])
92  ->getMock();
93 
94  $languageMock->expects($this->exactly(22))
95  ->method('txt')
96  ->willReturn('Something translated');
97 
98  $learningProgressMock = $this->getMockBuilder(ilObjectLP::class)
99  ->disableOriginalConstructor()
100  ->onlyMethods(['getCollectionInstance'])
101  ->getMock();
102 
103  $userDefinePlaceholderMock = $this->getMockBuilder(ilUserDefinedFieldsPlaceholderDescription::class)
104  ->disableOriginalConstructor()
105  ->getMock();
106 
107  $userDefinePlaceholderMock->method('createPlaceholderHtmlDescription')
108  ->willReturn('');
109 
110  $userDefinePlaceholderMock->method('getPlaceholderDescriptions')
111  ->willReturn([]);
112 
113  $placeholderDescriptionObject = new ilScormPlaceholderDescription(
114  $objectMock,
115  null,
116  $languageMock,
117  $learningProgressMock,
118  $userDefinePlaceholderMock
119  );
120 
121  $placeHolders = $placeholderDescriptionObject->getPlaceholderDescriptions();
122 
123  $this->assertSame(
124  [
125  'CERTIFICATE_ID' => 'Something translated',
126  'USER_LOGIN' => 'Something translated',
127  'USER_FULLNAME' => 'Something translated',
128  'USER_FIRSTNAME' => 'Something translated',
129  'USER_LASTNAME' => 'Something translated',
130  'USER_TITLE' => 'Something translated',
131  'USER_SALUTATION' => 'Something translated',
132  'USER_BIRTHDAY' => 'Something translated',
133  'USER_INSTITUTION' => 'Something translated',
134  'USER_DEPARTMENT' => 'Something translated',
135  'USER_STREET' => 'Something translated',
136  'USER_CITY' => 'Something translated',
137  'USER_ZIPCODE' => 'Something translated',
138  'USER_COUNTRY' => 'Something translated',
139  'USER_MATRICULATION' => 'Something translated',
140  'DATE' => 'Something translated',
141  'DATETIME' => 'Something translated',
142  'SCORM_TITLE' => 'Something translated',
143  'SCORM_POINTS' => 'Something translated',
144  'SCORM_POINTS_MAX' => 'Something translated',
145  'DATE_COMPLETED' => 'Something translated',
146  'DATETIME_COMPLETED' => 'Something translated'
147  ],
148  $placeHolders
149  );
150  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testPlaceholderGetHtmlDescription()

ilScormPlaceholderDescriptionTest::testPlaceholderGetHtmlDescription ( )

Definition at line 25 of file ilScormPlaceholderDescriptionTest.php.

References null.

25  : void
26  {
27  $objectMock = $this->getMockBuilder(ilObject::class)
28  ->disableOriginalConstructor()
29  ->getMock();
30 
31  $languageMock = $this->getMockBuilder(ilLanguage::class)
32  ->disableOriginalConstructor()
33  ->onlyMethods(['txt', 'loadLanguageModule'])
34  ->getMock();
35 
36  $templateMock = $this->getMockBuilder(ilTemplate::class)
37  ->disableOriginalConstructor()
38  ->getMock();
39 
40  $templateMock->method('get')
41  ->willReturn('');
42 
43  $collectionInstance = $this->getMockBuilder(ilLPCollectionOfSCOs::class)
44  ->disableOriginalConstructor()
45  ->onlyMethods(['getPossibleItems'])
46  ->getMock();
47 
48  $learningProgressMock = $this->getMockBuilder(ilObjectLP::class)
49  ->disableOriginalConstructor()
50  ->onlyMethods(['getCollectionInstance'])
51  ->getMock();
52 
53  $collectionInstance->method('getPossibleItems')
54  ->willReturn([0 => ['title' => 'Some SCORM Title']]);
55 
56  $learningProgressMock->method('getCollectionInstance')
57  ->willReturn($collectionInstance);
58 
59  $userDefinePlaceholderMock = $this->getMockBuilder(ilUserDefinedFieldsPlaceholderDescription::class)
60  ->disableOriginalConstructor()
61  ->getMock();
62 
63  $userDefinePlaceholderMock->method('createPlaceholderHtmlDescription')
64  ->willReturn('');
65 
66  $userDefinePlaceholderMock->method('getPlaceholderDescriptions')
67  ->willReturn([]);
68 
69  $placeholderDescriptionObject = new ilScormPlaceholderDescription(
70  $objectMock,
71  null,
72  $languageMock,
73  $learningProgressMock,
74  $userDefinePlaceholderMock
75  );
76 
77  $html = $placeholderDescriptionObject->createPlaceholderHtmlDescription($templateMock);
78 
79  $this->assertSame('', $html);
80  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

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