32 $defaultPlaceholderValues = $this->getMockBuilder(ilDefaultPlaceholderValues::class)
33 ->disableOriginalConstructor()
36 $language = $this->getMockBuilder(ilLanguage::class)
37 ->disableOriginalConstructor()
40 $language->method(
'txt')
41 ->willReturnCallback(
function ($variableValue) {
42 if ($variableValue ===
'lang_sep_decimal') {
44 } elseif ($variableValue ===
'lang_sep_thousand') {
48 return 'Some Translation: ' . $variableValue;
51 $language->expects($this->once())
52 ->method(
'loadLanguageModule');
54 $dateHelper = $this->getMockBuilder(ilCertificateDateHelper::class)
57 $objectMock = $this->getMockBuilder(ilObjSAHSLearningModule::class)
58 ->disableOriginalConstructor()
59 ->onlyMethods([
'getPointsInPercent',
'getMaxPoints',
'getTitle',
'getId'])
62 $objectMock->method(
'getPointsInPercent')
65 $objectMock->method(
'getMaxPoints')
68 $objectMock->method(
'getTitle')
69 ->willReturn(
'SomeTitle');
71 $objectMock->method(
'getId')
74 $user_object = $this->getMockBuilder(ilObjUser::class)
75 ->disableOriginalConstructor()
78 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
80 $objectHelper->method(
'getInstanceByObjId')
88 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
91 $utilHelper->method(
'prepareFormOutput')
92 ->willReturn(
'Formatted String');
94 $objectLPHelper = $this->getMockBuilder(ilCertificateObjectLPHelper::class)
97 $lpCollection = $this->getMockBuilder(ilLPCollectionOfSCOs::class)
98 ->disableOriginalConstructor()
99 ->onlyMethods([
'getPossibleItems',
'getScoresForUserAndCP_Node_Id',
'isAssignedEntry'])
102 $lpCollection->method(
'getPossibleItems')
103 ->willReturn([100 => [
'title' =>
'Some Title']]);
105 $lpCollection->method(
'getScoresForUserAndCP_Node_Id')
114 $lpCollection->method(
'isAssignedEntry')
117 $olp = $this->getMockBuilder(ilObjectLP::class)
118 ->disableOriginalConstructor()
119 ->onlyMethods([
'getCollectionInstance'])
122 $olp->method(
'getCollectionInstance')
123 ->willReturn($lpCollection);
125 $objectLPHelper->method(
'getInstance')
128 $lpStatusHelper = $this->getMockBuilder(ilCertificateLPStatusHelper::class)
131 $lpStatusHelper->method(
'lookupStatusChanged')
132 ->willReturn(
'2018-12-01 13:00:11');
135 $defaultPlaceholderValues,
144 $result = $scormPlaceholderValues->getPlaceholderValues(10, 200);
148 'SCORM_TITLE' =>
'Formatted String',
149 'SCORM_POINTS' =>
'100,0 %',
150 'SCORM_POINTS_MAX' => 100,
151 'SCO_T_0' =>
'Some Title',
152 'SCO_P_0' =>
'100,0',
153 'SCO_PM_0' =>
'300,0',
154 'SCO_PP_0' =>
'200,0 %',
155 'DATE_COMPLETED' =>
'',
156 'DATETIME_COMPLETED' =>
''