11 $objectMock = $this->getMockBuilder(
'ilObjUser')
12 ->disableOriginalConstructor()
33 $objectMock->expects($this->
once())
35 ->willReturn(
'a_login');
37 $objectMock->expects($this->
once())
38 ->method(
'getFullname')
39 ->willReturn(
'Niels Theen');
41 $objectMock->expects($this->
once())
42 ->method(
'getFirstname')
43 ->willReturn(
'Niels');
45 $objectMock->expects($this->
once())
46 ->method(
'getLastname')
47 ->willReturn(
'Theen');
49 $objectMock->expects($this->
once())
53 $objectMock->expects($this->
once())
57 $objectMock->expects($this->
once())
58 ->method(
'getBirthday')
59 ->willReturn(
'2018-10-10');
61 $objectMock->expects($this->
once())
62 ->method(
'getInstitution')
65 $objectMock->expects($this->
once())
66 ->method(
'getDepartment')
69 $objectMock->expects($this->
once())
73 $objectMock->expects($this->
once())
77 $objectMock->expects($this->
once())
78 ->method(
'getZipcode')
81 $objectMock->expects($this->
once())
82 ->method(
'getCountry')
85 $objectMock->expects($this->
once())
86 ->method(
'getMatriculation')
89 $objectHelper = $this->getMockBuilder(
'ilCertificateObjectHelper')
92 $objectHelper->expects($this->
once())
93 ->method(
'getInstanceByObjId')
95 ->willReturn($objectMock);
97 $dateHelper = $this->getMockBuilder(
'ilCertificateDateHelper')
100 $dateHelper->expects($this->exactly(2))
101 ->method(
'formatDate')
102 ->willReturn(
'2018-09-10');
104 $dateHelper->expects($this->
once())
105 ->method(
'formatDateTime')
106 ->willReturn(
'2018-09-10 12:01:33');
108 $language = $this->getMockBuilder(
'ilLanguage')
109 ->disableOriginalConstructor()
113 ->willReturn(
'Something');
115 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
118 $utilHelper->method(
'prepareFormOutput')
119 ->willReturnCallback(
function (
$input) {
123 $userDefinePlaceholderMock = $this->getMockBuilder(
'ilUserDefinedFieldsPlaceholderValues')
124 ->disableOriginalConstructor()
127 $userDefinePlaceholderMock->method(
'getPlaceholderValues')
128 ->willReturn(array());
130 $userDefinePlaceholderMock->method(
'getPlaceholderValuesForPreview')
131 ->willReturn(array());
139 $userDefinePlaceholderMock,
143 $result = $placeHolderObject->getPlaceholderValues(100, 200);
147 'USER_LOGIN' =>
'a_login',
148 'USER_FULLNAME' =>
'Niels Theen',
149 'USER_FIRSTNAME' =>
'Niels',
150 'USER_LASTNAME' =>
'Theen',
152 'USER_SALUTATION' =>
'Something',
153 'USER_BIRTHDAY' =>
'2018-09-10',
154 'USER_INSTITUTION' =>
'',
155 'USER_DEPARTMENT' =>
'',
158 'USER_ZIPCODE' =>
'',
159 'USER_COUNTRY' =>
'',
160 'USER_MATRICULATION' =>
'',
163 'DATE_COMPLETED' =>
'',
164 'DATETIME_COMPLETED' =>
'',
165 'DATE' =>
'2018-09-10',
166 'DATETIME' =>
'2018-09-10 12:01:33' 174 $objectHelper = $this->getMockBuilder(
'ilCertificateObjectHelper')
177 $dateHelper = $this->getMockBuilder(
'ilCertificateDateHelper')
180 $dateHelper->method(
'formatDate')
181 ->willReturn(
'2018-09-09');
183 $dateHelper->method(
'formatDateTime')
184 ->willReturn(
'2018-09-09 14:00:30');
186 $language = $this->getMockBuilder(
'ilLanguage')
187 ->disableOriginalConstructor()
191 ->willReturn(
'Something');
193 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
196 $utilHelper->method(
'prepareFormOutput')
197 ->willReturnCallback(
function (
$input) {
201 $userDefinePlaceholderMock = $this->getMockBuilder(
'ilUserDefinedFieldsPlaceholderValues')
202 ->disableOriginalConstructor()
205 $userDefinePlaceholderMock->method(
'getPlaceholderValues')
206 ->willReturn(array());
208 $userDefinePlaceholderMock->method(
'getPlaceholderValuesForPreview')
209 ->willReturn(array());
217 $userDefinePlaceholderMock,
221 $result = $placeHolderObject->getPlaceholderValuesForPreview(
229 'USER_LOGIN' =>
'Something',
230 'USER_FULLNAME' =>
'Something',
231 'USER_FIRSTNAME' =>
'Something',
232 'USER_LASTNAME' =>
'Something',
233 'USER_TITLE' =>
'Something',
234 'USER_SALUTATION' =>
'Something',
235 'USER_BIRTHDAY' =>
'2018-09-09',
236 'USER_INSTITUTION' =>
'Something',
237 'USER_DEPARTMENT' =>
'Something',
238 'USER_STREET' =>
'Something',
239 'USER_CITY' =>
'Something',
240 'USER_ZIPCODE' =>
'Something',
241 'USER_COUNTRY' =>
'Something',
242 'USER_MATRICULATION' =>
'Something',
243 'DATE' =>
'2018-09-09',
244 'DATETIME' =>
'2018-09-09 14:00:30',
245 'DATE_COMPLETED' =>
'2018-09-09',
246 'DATETIME_COMPLETED' =>
'2018-09-09 14:00:30' Collection of basic placeholder values that can be used.
testGetPlaceholderValues()
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
testGetPlaceholderValuesForPreview()