135 $defaultPlaceholderValues = $this->getMockBuilder(
'ilDefaultPlaceholderValues')
136 ->disableOriginalConstructor()
139 $defaultPlaceholderValues->method(
'getPlaceholderValuesForPreview')
142 'SOME_PLACEHOLDER' =>
'aaa',
143 'SOME_OTHER_PLACEHOLDER' =>
'bbb' 147 $language = $this->getMockBuilder(
'ilLanguage')
148 ->disableOriginalConstructor()
151 $language->method(
'txt')
152 ->willReturnCallback(
function ($variableValue) {
153 if ($variableValue ===
'lang_sep_decimal') {
155 } elseif ($variableValue ===
'lang_sep_thousand') {
159 return 'Some Translation: ' . $variableValue;
162 $dateHelper = $this->getMockBuilder(
'ilCertificateDateHelper')
165 $objectMock = $this->getMockBuilder(
'ilObject')
166 ->disableOriginalConstructor()
169 $objectMock->method(
'getTitle')
170 ->willReturn(
'Some Title');
172 $objectHelper = $this->getMockBuilder(
'ilCertificateObjectHelper')
175 $objectHelper->method(
'getInstanceByObjId')
176 ->willReturn($objectMock);
178 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
181 $utilHelper->method(
'prepareFormOutput')
182 ->willReturnCallback(
function ($input) {
186 $objectLPHelper = $this->getMockBuilder(
'ilCertificateObjectLPHelper')
189 $lpCollection = $this->getMockBuilder(
'ilLPCollection')
190 ->disableOriginalConstructor()
191 ->setMethods(array(
'getPossibleItems',
'isAssignedEntry'))
194 $lpCollection->method(
'getPossibleItems')
197 'title' =>
'Some Title' 200 'title' =>
'Some Other Title' 204 $lpCollection->method(
'isAssignedEntry')
207 $objectLPMock = $this->getMockBuilder(
'ilObjectLP')
208 ->disableOriginalConstructor()
211 $objectLPMock->method(
'getCollectionInstance')
212 ->willReturn($lpCollection);
214 $objectLPHelper->method(
'getInstance')
215 ->willReturn($objectLPMock);
217 $lpStatusHelper = $this->getMockBuilder(
'ilCertificateLPStatusHelper')
221 $defaultPlaceholderValues,
230 $result = $scormPlaceholderValues->getPlaceholderValuesForPreview(100, 10);
234 'SCORM_TITLE' =>
'Some Title',
235 'SCORM_POINTS' =>
'80,7 %',
236 'SCORM_POINTS_MAX' =>
'90',
237 'SCO_T_0' =>
'Some Title',
239 'SCO_PM_0' =>
'90,9',
240 'SCO_PP_0' =>
'33,3 %',
241 'SCO_T_1' =>
'Some Other Title',
243 'SCO_PM_1' =>
'90,9',
244 'SCO_PP_1' =>
'33,3 %',
245 'SOME_PLACEHOLDER' =>
'aaa',
246 'SOME_OTHER_PLACEHOLDER' =>
'bbb'