64 $learningHistoryFactory = $this->getMockBuilder(
'ilLearningHistoryFactory')
65 ->disableOriginalConstructor()
68 $language = $this->getMockBuilder(
'ilLanguage')
69 ->disableOriginalConstructor()
73 ->willReturnOnConsecutiveCalls(
74 'Certificate for %1$s',
76 'Certificate for %1$s',
80 $dic = $this->getMockBuilder(
'\ILIAS\DI\Container')
81 ->disableOriginalConstructor()
84 $template = $this->getMockBuilder(
'ilTemplate')
85 ->disableOriginalConstructor()
89 ->willReturnOnConsecutiveCalls(
'Course Title',
'Test Title');
91 $userCertificateRepository = $this->getMockBuilder(
'ilUserCertificateRepository')
92 ->disableOriginalConstructor()
95 $userCertificateRepository->method(
'fetchActiveCertificatesInIntervalForPresentation')
106 '<xml>Some Content</xml>',
107 '["SOME_PLACEHOLDER"]',
112 '/some/where/background_1.jpg',
113 '/some/where/else/thumbnail_1.jpg',
127 '<xml>Some Content</xml>',
128 '["SOME_PLACEHOLDER"]',
133 '/some/where/background_1.jpg',
134 '/some/where/else/thumbnail_1.jpg',
143 $controller = $this->getMockBuilder(
'ilCtrl')
144 ->disableOriginalConstructor()
148 ->expects($this->exactly(2))
149 ->method(
'getLinkTargetByClass')
150 ->willReturn(
'<a href> </a>');
153 ->expects($this->exactly(2))
154 ->method(
'clearParametersByClass');
157 ->expects($this->exactly(2))
158 ->method(
'setParameterByClass');
160 $certificateSettings = $this->getMockBuilder(
'ilSetting')
161 ->disableOriginalConstructor()
164 $certificateSettings->method(
'get')
167 $uiFactory = $this->getMockBuilder(
'ILIAS\UI\Factory')
168 ->disableOriginalConstructor()
171 $link = $this->getMockBuilder(
'\ILIAS\UI\Component\Link\Factory')
172 ->disableOriginalConstructor()
175 $link->method(
'standard')
177 array(
'Course Title',
'<a href> </a>'),
178 array(
'Test Title',
'<a href> </a>')
180 ->willReturn(
'<link rel="stylesheet" href="">');
182 $uiFactory->method(
'link')
185 $uiRenderer = $this->getMockBuilder(
'ILIAS\UI\Renderer')
186 ->disableOriginalConstructor()
189 $uiRenderer->method(
'render')
190 ->with(
'<link rel="stylesheet" href="">')
191 ->willReturn(
'link');
193 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
194 ->disableOriginalConstructor()
197 $utilHelper->method(
'getImagePath')
198 ->willReturn(
'/some/acutal/image/path/background.png');
202 $learningHistoryFactory,
206 $userCertificateRepository,
208 $certificateSettings,
214 $expectedEntries = array(
216 'Certificate for link achieved.',
217 'Certificate for link achieved.',
218 '/some/acutal/image/path/background.png',
223 'Certificate for link achieved.',
224 'Certificate for link achieved.',
225 '/some/acutal/image/path/background.png',
230 $actualEntries =
$provider->getEntries(123456789, 987654321);
231 $this->assertEquals($expectedEntries, $actualEntries);