28 $objectMock = $this->getMockBuilder(ilObjUser::class)
29 ->disableOriginalConstructor()
50 $objectMock->expects($this->once())
52 ->willReturn(
'a_login');
54 $objectMock->expects($this->once())
55 ->method(
'getFullname')
56 ->willReturn(
'Niels Theen');
58 $objectMock->expects($this->once())
59 ->method(
'getFirstname')
60 ->willReturn(
'Niels');
62 $objectMock->expects($this->once())
63 ->method(
'getLastname')
64 ->willReturn(
'Theen');
66 $objectMock->expects($this->once())
70 $objectMock->expects($this->once())
74 $objectMock->expects($this->once())
75 ->method(
'getBirthday')
76 ->willReturn(
'2018-10-10');
78 $objectMock->expects($this->once())
79 ->method(
'getInstitution')
82 $objectMock->expects($this->once())
83 ->method(
'getDepartment')
86 $objectMock->expects($this->once())
90 $objectMock->expects($this->once())
94 $objectMock->expects($this->once())
95 ->method(
'getZipcode')
98 $objectMock->expects($this->once())
99 ->method(
'getCountry')
102 $objectMock->expects($this->once())
103 ->method(
'getMatriculation')
106 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
109 $objectHelper->expects($this->once())
110 ->method(
'getInstanceByObjId')
112 ->willReturn($objectMock);
114 $dateHelper = $this->getMockBuilder(ilCertificateDateHelper::class)
117 $dateHelper->expects($this->exactly(2))
118 ->method(
'formatDate')
119 ->willReturn(
'2018-09-10');
121 $dateHelper->expects($this->once())
122 ->method(
'formatDateTime')
123 ->willReturn(
'2018-09-10 12:01:33');
125 $language = $this->getMockBuilder(ilLanguage::class)
126 ->disableOriginalConstructor()
129 $language->method(
'txt')
130 ->willReturn(
'Something');
132 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
133 ->disableOriginalConstructor()
136 $utilHelper->method(
'prepareFormOutput')
137 ->willReturnCallback(
function ($input) {
141 $userDefinePlaceholderMock = $this->getMockBuilder(ilUserDefinedFieldsPlaceholderValues::class)
142 ->disableOriginalConstructor()
145 $userDefinePlaceholderMock->method(
'getPlaceholderValues')
148 $userDefinePlaceholderMock->method(
'getPlaceholderValuesForPreview')
151 $uuid_factory_mock = $this->getMockBuilder(
ILIAS\
Data\UUID\Factory::class)
153 $uuid_factory_mock->method(
'uuid4AsString')->willReturn(
'randomUniqueString');
161 $userDefinePlaceholderMock,
165 $placeHolderObject->setUserLanguage($language);
167 $result = $placeHolderObject->getPlaceholderValues(100, 200);
171 'CERTIFICATE_ID' =>
'',
172 'USER_LOGIN' =>
'a_login',
173 'USER_FULLNAME' =>
'Niels Theen',
174 'USER_FIRSTNAME' =>
'Niels',
175 'USER_LASTNAME' =>
'Theen',
177 'USER_SALUTATION' =>
'Something',
178 'USER_BIRTHDAY' =>
'2018-09-10',
179 'USER_INSTITUTION' =>
'',
180 'USER_DEPARTMENT' =>
'',
183 'USER_ZIPCODE' =>
'',
184 'USER_COUNTRY' =>
'',
185 'USER_MATRICULATION' =>
'',
186 'DATE_COMPLETED' =>
'',
187 'DATETIME_COMPLETED' =>
'',
188 'DATE' =>
'2018-09-10',
189 'DATETIME' =>
'2018-09-10 12:01:33'
Interface Observer Contains several chained tasks and infos about them.