10 {
11 $defaultPlaceholderValues = $this->getMockBuilder('ilDefaultPlaceholderValues')
12 ->disableOriginalConstructor()
13 ->getMock();
14
15 $defaultPlaceholderValues->method('getPlaceholderValues')
16 ->willReturn(array());
17
18 $language = $this->getMockBuilder(
'ilLanguage')
19 ->disableOriginalConstructor()
20 ->getMock();
21
23 ->willReturn('Something');
24
25 $objectMock = $this->getMockBuilder('ilObject')
26 ->disableOriginalConstructor()
27 ->getMock();
28
29 $objectMock->method('getTitle')
30 ->willReturn('Some Title');
31
32 $objectHelper = $this->getMockBuilder('ilCertificateObjectHelper')
33 ->getMock();
34
35 $objectHelper->method('getInstanceByObjId')
36 ->willReturn($objectMock);
37
38 $participantsHelper = $this->getMockBuilder('ilCertificateParticipantsHelper')
39 ->getMock();
40
41 $participantsHelper->method('getDateTimeOfPassed')
42 ->willReturn('2018-09-10');
43
44 $ilUtilHelper = $this->getMockBuilder('ilCertificateUtilHelper')
45 ->getMock();
46
47 $ilUtilHelper->method('prepareFormOutput')
48 ->willReturn('Some Title');
49
50 $ilDateHelper = $this->getMockBuilder('ilCertificateDateHelper')
51 ->getMock();
52
53 $ilDateHelper->method('formatDate')
54 ->willReturn('2018-09-10');
55
56 $ilDateHelper->method('formatDateTime')
57 ->willReturn('2018-09-10 10:32:00');
58
60 $defaultPlaceholderValues,
62 $objectHelper,
63 $participantsHelper,
64 $ilUtilHelper,
65 $ilDateHelper
66 );
67
68 $placeholderValues = $valuesObject->getPlaceholderValues(100, 200);
69
70 $this->assertEquals(
71 array(
72 'COURSE_TITLE' => 'Some Title',
73 'DATE_COMPLETED' => '2018-09-10',
74 'DATETIME_COMPLETED' => '2018-09-10 10:32:00'
75 ),
76 $placeholderValues
77 );
78 }