19 declare(strict_types=1);
28 $defaultPlaceholders = $this->getMockBuilder(ilDefaultPlaceholderValues::class)
29 ->disableOriginalConstructor()
32 $language = $this->getMockBuilder(ilLanguage::class)
33 ->disableOriginalConstructor()
36 $language->method(
'txt')
37 ->willReturn(
'Some Translation');
39 $objectMock = $this->getMockBuilder(ilObject::class)
40 ->disableOriginalConstructor()
43 $objectMock->expects($this->once())
45 ->willReturn(
'Some Title');
47 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
50 $objectHelper->expects($this->once())
51 ->method(
'getInstanceByObjId')
53 ->willReturn($objectMock);
55 $lpMarksHelper = $this->getMockBuilder(ilCertificateLPMarksHelper::class)
58 $lpMarksHelper->expects($this->once())
59 ->method(
'lookUpMark')
62 $exerciseMemberHelper = $this->getMockBuilder(ilCertificateExerciseMembersHelper::class)
65 $lpStatusHelper = $this->getMockBuilder(ilCertificateLPStatusHelper::class)
68 $lpStatusHelper->method(
'lookupStatusChanged')
71 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
74 $utilHelper->expects($this->exactly(2))
75 ->method(
'prepareFormOutput')
76 ->willReturn(
'Some Formatted Output');
78 $dateHelper = $this->getMockBuilder(ilCertificateDateHelper::class)
81 $dateHelper->expects($this->once())
82 ->method(
'formatDate')
83 ->willReturn(
'2018-09-10');
85 $dateHelper->expects($this->once())
86 ->method(
'formatDateTime')
87 ->willReturn(
'2018-09-10 12:01:33');
95 $exerciseMemberHelper,
101 $result = $placeHolderObject->getPlaceholderValues(100, 200);
105 'RESULT_MARK' =>
'Some Formatted Output',
106 'EXERCISE_TITLE' =>
'Some Formatted Output',
107 'DATE_COMPLETED' =>
'2018-09-10',
108 'DATETIME_COMPLETED' =>
'2018-09-10 12:01:33' 116 $defaultPlaceholders = $this->getMockBuilder(ilDefaultPlaceholderValues::class)
117 ->disableOriginalConstructor()
120 $language = $this->getMockBuilder(ilLanguage::class)
121 ->disableOriginalConstructor()
124 $language->method(
'txt')
125 ->willReturn(
'Something');
127 $objectMock = $this->getMockBuilder(ilObject::class)
128 ->disableOriginalConstructor()
131 $objectMock->method(
'getTitle')
132 ->willReturn(
'SomeTitle');
134 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
137 $objectHelper->method(
'getInstanceByObjId')
138 ->willReturn($objectMock);
140 $lpMarksHelper = $this->getMockBuilder(ilCertificateLPMarksHelper::class)
143 $exerciseMemberHelper = $this->getMockBuilder(ilCertificateExerciseMembersHelper::class)
146 $lpStatusHelper = $this->getMockBuilder(ilCertificateLPStatusHelper::class)
149 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
152 $utilHelper->method(
'prepareFormOutput')
153 ->willReturnCallback(
function ($input) {
157 $dateHelper = $this->getMockBuilder(ilCertificateDateHelper::class)
161 ->expects($this->atLeastOnce())
162 ->method(
'getPlaceholderValuesForPreview')
163 ->willReturn([
'SOME_PLACEHOLDER' =>
'something']);
166 $defaultPlaceholders,
170 $exerciseMemberHelper,
176 $result = $placeHolderObject->getPlaceholderValuesForPreview(100, 10);
180 'SOME_PLACEHOLDER' =>
'something',
181 'RESULT_PASSED' =>
'Something',
182 'EXERCISE_TITLE' =>
'SomeTitle',
183 'RESULT_MARK' =>
'Something' Class ilCertificateBaseTestCase.
testGetPlaceholderValuesForPreview()
testGetPlaceholderValues()