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' Collection of basic placeholder values that can be used.
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.