25 $objectMock = $this->getMockBuilder(ilObjUser::class)
26 ->disableOriginalConstructor()
47 $objectMock->expects($this->once())
49 ->willReturn(
'a_login');
51 $objectMock->expects($this->once())
52 ->method(
'getFullname')
53 ->willReturn(
'Niels Theen');
55 $objectMock->expects($this->once())
56 ->method(
'getFirstname')
57 ->willReturn(
'Niels');
59 $objectMock->expects($this->once())
60 ->method(
'getLastname')
61 ->willReturn(
'Theen');
63 $objectMock->expects($this->once())
67 $objectMock->expects($this->once())
71 $objectMock->expects($this->once())
72 ->method(
'getBirthday')
73 ->willReturn(
'2018-10-10');
75 $objectMock->expects($this->once())
76 ->method(
'getInstitution')
79 $objectMock->expects($this->once())
80 ->method(
'getDepartment')
83 $objectMock->expects($this->once())
87 $objectMock->expects($this->once())
91 $objectMock->expects($this->once())
92 ->method(
'getZipcode')
95 $objectMock->expects($this->once())
96 ->method(
'getCountry')
99 $objectMock->expects($this->once())
100 ->method(
'getMatriculation')
103 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
106 $objectHelper->expects($this->once())
107 ->method(
'getInstanceByObjId')
109 ->willReturn($objectMock);
111 $dateHelper = $this->getMockBuilder(ilCertificateDateHelper::class)
114 $dateHelper->expects($this->exactly(2))
115 ->method(
'formatDate')
116 ->willReturn(
'2018-09-10');
118 $dateHelper->expects($this->once())
119 ->method(
'formatDateTime')
120 ->willReturn(
'2018-09-10 12:01:33');
122 $language = $this->getMockBuilder(ilLanguage::class)
123 ->disableOriginalConstructor()
126 $language->method(
'txt')
127 ->willReturn(
'Something');
129 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
130 ->disableOriginalConstructor()
133 $utilHelper->method(
'prepareFormOutput')
134 ->willReturnCallback(
function ($input) {
138 $userDefinePlaceholderMock = $this->getMockBuilder(ilUserDefinedFieldsPlaceholderValues::class)
139 ->disableOriginalConstructor()
142 $userDefinePlaceholderMock->method(
'getPlaceholderValues')
145 $userDefinePlaceholderMock->method(
'getPlaceholderValuesForPreview')
148 $uuid_factory_mock = $this->getMockBuilder(
ILIAS\
Data\UUID\Factory::class)
150 $uuid_factory_mock->method(
'uuid4AsString')->willReturn(
'randomUniqueString');
158 $userDefinePlaceholderMock,
162 $placeHolderObject->setUserLanguage($language);
164 $result = $placeHolderObject->getPlaceholderValues(100, 200);
168 'CERTIFICATE_ID' =>
'',
169 'USER_LOGIN' =>
'a_login',
170 'USER_FULLNAME' =>
'Niels Theen',
171 'USER_FIRSTNAME' =>
'Niels',
172 'USER_LASTNAME' =>
'Theen',
174 'USER_SALUTATION' =>
'Something',
175 'USER_BIRTHDAY' =>
'2018-09-10',
176 'USER_INSTITUTION' =>
'',
177 'USER_DEPARTMENT' =>
'',
180 'USER_ZIPCODE' =>
'',
181 'USER_COUNTRY' =>
'',
182 'USER_MATRICULATION' =>
'',
183 'DATE_COMPLETED' =>
'',
184 'DATETIME_COMPLETED' =>
'',
185 'DATE' =>
'2018-09-10',
186 'DATETIME' =>
'2018-09-10 12:01:33'
Interface Observer Contains several chained tasks and infos about them.