◆ testA()
ilTestPlaceholderValuesTest::testA |
( |
| ) |
|
Definition at line 26 of file ilTestPlaceHolderValuesTest.php.
28 $defaultPlaceholderValues = $this->getMockBuilder(ilDefaultPlaceholderValues::class)
29 ->disableOriginalConstructor()
32 $language = $this->getMockBuilder(ilLanguage::class)
33 ->disableOriginalConstructor()
36 $language->method(
'txt')
37 ->willReturn(
'Some Translation');
39 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
42 $testObject = $this->getMockBuilder(ilObjTest::class)
43 ->disableOriginalConstructor()
46 $testObject->method(
'getActiveIdOfUser')
49 $testObject->method(
'getTestResult')
54 'total_max_points' => 70,
55 'total_reached_points' => 50
60 $testObject->method(
'getTestResult')
64 $testObject->method(
'getTitle')
65 ->willReturn(
' Some Title');
67 $markSchema = $this->getMockBuilder(
'ASS_MarkSchema')
68 ->disableOriginalConstructor()
71 $matchingMark = $this->getMockBuilder(
'ASS_Mark')
74 $matchingMark->method(
'getShortName')
77 $matchingMark->method(
'getOfficialName')
80 $markSchema->method(
'getMatchingMark')
81 ->willReturn($matchingMark);
83 $testObject->method(
'getMarkSchema')
84 ->willReturn($markSchema);
86 $objectHelper->method(
'getInstanceByObjId')
87 ->willReturn($testObject);
89 $testObjectHelper = $this->getMockBuilder(ilCertificateTestObjectHelper::class)
92 $userObjectHelper = $this->getMockBuilder(ilCertificateUserObjectHelper::class)
95 $userObjectHelper->method(
'lookupFields')
96 ->willReturn([
'usr_id' => 10]);
98 $lpStatusHelper = $this->getMockBuilder(ilCertificateLPStatusHelper::class)
101 $lpStatusHelper->method(
'lookupStatusChanged')
102 ->willReturn(
'2018-01-12');
104 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
107 $utilHelper->method(
'prepareFormOutput')
108 ->willReturn(
'Formatted Output');
110 $dateHelper = $this->getMockBuilder(ilCertificateDateHelper::class)
113 $dateHelper->method(
'formatDate')
114 ->willReturn(
'2018-01-12');
116 $dateHelper->method(
'formatDateTime')
117 ->willReturn(
'2018-01-12 10:32:01');
120 $defaultPlaceholderValues,
130 $result = $placeholdervalues->getPlaceholderValues(10, 200);
133 'RESULT_PASSED' =>
'Formatted Output',
134 'RESULT_POINTS' =>
'Formatted Output',
135 'RESULT_PERCENT' =>
'71.43%',
136 'MAX_POINTS' =>
'Formatted Output',
137 'RESULT_MARK_SHORT' =>
'Formatted Output',
138 'RESULT_MARK_LONG' =>
'Formatted Output',
139 'TEST_TITLE' =>
'Formatted Output',
140 'DATE_COMPLETED' =>
'2018-01-12',
141 'DATETIME_COMPLETED' =>
'2018-01-12 10:32:01'
◆ testGetPlaceholderValuesForPreview()
ilTestPlaceholderValuesTest::testGetPlaceholderValuesForPreview |
( |
| ) |
|
Definition at line 146 of file ilTestPlaceHolderValuesTest.php.
148 $defaultPlaceholderValues = $this->getMockBuilder(ilDefaultPlaceholderValues::class)
149 ->disableOriginalConstructor()
152 $defaultPlaceholderValues->method(
'getPlaceholderValuesForPreview')
155 'SOME_PLACEHOLDER' =>
'something',
156 'SOME_OTHER_PLACEHOLDER' =>
'something else',
160 $language = $this->getMockBuilder(ilLanguage::class)
161 ->disableOriginalConstructor()
164 $language->method(
'txt')
165 ->willReturn(
'Something');
167 $objectMock = $this->getMockBuilder(ilObject::class)
168 ->disableOriginalConstructor()
171 $objectMock->method(
'getTitle')
172 ->willReturn(
'SomeTitle');
174 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
177 $objectHelper->method(
'getInstanceByObjId')
178 ->willReturn($objectMock);
180 $testObjectHelper = $this->getMockBuilder(ilCertificateTestObjectHelper::class)
183 $userObjectHelper = $this->getMockBuilder(ilCertificateUserObjectHelper::class)
186 $lpStatusHelper = $this->getMockBuilder(ilCertificateLPStatusHelper::class)
189 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
192 $utilHelper->method(
'prepareFormOutput')
193 ->willReturnCallback(
function ($input) {
197 $dateHelper = $this->getMockBuilder(ilCertificateDateHelper::class)
201 $defaultPlaceholderValues,
211 $result = $placeholdervalues->getPlaceholderValuesForPreview(100, 10);
215 'SOME_PLACEHOLDER' =>
'something',
216 'SOME_OTHER_PLACEHOLDER' =>
'something else',
217 'RESULT_PASSED' =>
'Something',
218 'RESULT_POINTS' =>
'Something',
219 'RESULT_PERCENT' =>
'Something',
220 'MAX_POINTS' =>
'Something',
221 'RESULT_MARK_SHORT' =>
'Something',
222 'RESULT_MARK_LONG' =>
'Something',
223 'TEST_TITLE' =>
'SomeTitle'
The documentation for this class was generated from the following file: