11 $defaultPlaceholderValues = $this->getMockBuilder(
'ilDefaultPlaceholderValues')
12 ->disableOriginalConstructor()
15 $language = $this->getMockBuilder(
'ilLanguage')
16 ->disableOriginalConstructor()
20 ->willReturnCallback(
function ($variableValue) {
21 if ($variableValue ===
'lang_sep_decimal') {
23 } elseif ($variableValue ===
'lang_sep_thousand') {
27 return 'Some Translation: ' . $variableValue;
31 ->method(
'loadLanguageModule');
33 $dateHelper = $this->getMockBuilder(
'ilCertificateDateHelper')
36 $objectMock = $this->getMockBuilder(
'ilObject')
37 ->disableOriginalConstructor()
38 ->setMethods(array(
'getPointsInPercent',
'getMaxPoints',
'getTitle',
'getId'))
41 $objectMock->method(
'getPointsInPercent')
44 $objectMock->method(
'getMaxPoints')
47 $objectMock->method(
'getTitle')
48 ->willReturn(
'SomeTitle');
50 $objectMock->method(
'getId')
53 $objectHelper = $this->getMockBuilder(
'ilCertificateObjectHelper')
56 $objectHelper->method(
'getInstanceByObjId')
57 ->willReturn($objectMock);
59 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
62 $utilHelper->method(
'prepareFormOutput')
63 ->willReturn(
'Formatted String');
65 $objectLPHelper = $this->getMockBuilder(
'ilCertificateObjectLPHelper')
68 $lpCollection = $this->getMockBuilder(
'ilLPCollection')
69 ->disableOriginalConstructor()
70 ->setMethods(array(
'getPossibleItems',
'getScoresForUserAndCP_Node_Id',
'isAssignedEntry'))
73 $lpCollection->method(
'getPossibleItems')
74 ->willReturn(array(100 => array(
'title' =>
'Some Title')));
76 $lpCollection->method(
'getScoresForUserAndCP_Node_Id')
85 $lpCollection->method(
'isAssignedEntry')
88 $olp = $this->getMockBuilder(
'ilObjectLP')
89 ->disableOriginalConstructor()
90 ->setMethods(array(
'getCollectionInstance'))
93 $olp->method(
'getCollectionInstance')
94 ->willReturn($lpCollection);
96 $objectLPHelper->method(
'getInstance')
99 $lpStatusHelper = $this->getMockBuilder(
'ilCertificateLPStatusHelper')
102 $lpStatusHelper->method(
'lookupStatusChanged')
103 ->willReturn(
'2018-12-01 13:00:11');
106 $defaultPlaceholderValues,
115 $result = $scormPlaceholderValues->getPlaceholderValues(10, 200);
119 'SCORM_TITLE' =>
'Formatted String',
120 'SCORM_POINTS' =>
'100,0 %',
121 'SCORM_POINTS_MAX' => 100,
122 'SCO_T_0' =>
'Some Title',
123 'SCO_P_0' =>
'100,0',
124 'SCO_PM_0' =>
'300,0',
125 'SCO_PP_0' =>
'200,0 %',
126 'DATE_COMPLETED' =>
'',
127 'DATETIME_COMPLETED' =>
''
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.