149 $defaultPlaceholderValues = $this->getMockBuilder(ilDefaultPlaceholderValues::class)
150 ->disableOriginalConstructor()
153 $defaultPlaceholderValues->method(
'getPlaceholderValuesForPreview')
156 'SOME_PLACEHOLDER' =>
'aaa',
157 'SOME_OTHER_PLACEHOLDER' =>
'bbb' 161 $language = $this->getMockBuilder(ilLanguage::class)
162 ->disableOriginalConstructor()
165 $language->method(
'txt')
166 ->willReturnCallback(
function ($variableValue) {
167 if ($variableValue ===
'lang_sep_decimal') {
169 } elseif ($variableValue ===
'lang_sep_thousand') {
173 return 'Some Translation: ' . $variableValue;
176 $dateHelper = $this->getMockBuilder(ilCertificateDateHelper::class)
179 $objectMock = $this->getMockBuilder(ilObject::class)
180 ->disableOriginalConstructor()
183 $objectMock->method(
'getTitle')
184 ->willReturn(
'Some Title');
186 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
189 $objectHelper->method(
'getInstanceByObjId')
190 ->willReturn($objectMock);
192 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
195 $utilHelper->method(
'prepareFormOutput')
196 ->willReturnCallback(
function ($input) {
200 $objectLPHelper = $this->getMockBuilder(ilCertificateObjectLPHelper::class)
203 $lpCollection = $this->getMockBuilder(ilLPCollectionOfSCOs::class)
204 ->disableOriginalConstructor()
205 ->onlyMethods([
'getPossibleItems',
'isAssignedEntry'])
208 $lpCollection->method(
'getPossibleItems')
211 'title' =>
'Some Title' 214 'title' =>
'Some Other Title' 218 $lpCollection->method(
'isAssignedEntry')
221 $objectLPMock = $this->getMockBuilder(ilObjectLP::class)
222 ->disableOriginalConstructor()
225 $objectLPMock->method(
'getCollectionInstance')
226 ->willReturn($lpCollection);
228 $objectLPHelper->method(
'getInstance')
229 ->willReturn($objectLPMock);
231 $lpStatusHelper = $this->getMockBuilder(ilCertificateLPStatusHelper::class)
235 $defaultPlaceholderValues,
244 $result = $scormPlaceholderValues->getPlaceholderValuesForPreview(100, 10);
248 'SCORM_TITLE' =>
'Some Title',
249 'SCORM_POINTS' =>
'80,7 %',
250 'SCORM_POINTS_MAX' =>
'90',
251 'SCO_T_0' =>
'Some Title',
253 'SCO_PM_0' =>
'90,9',
254 'SCO_PP_0' =>
'33,3 %',
255 'SCO_T_1' =>
'Some Other Title',
257 'SCO_PM_1' =>
'90,9',
258 'SCO_PP_1' =>
'33,3 %',
259 'SOME_PLACEHOLDER' =>
'aaa',
260 'SOME_OTHER_PLACEHOLDER' =>
'bbb'