ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilCertificateTemplateExportActionTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
25 public function testExport(): void
26 {
27 $templateRepository = $this->getMockBuilder(ilCertificateTemplateRepository::class)->getMock();
28
29 $templateRepository->method('fetchCurrentlyActiveCertificate')
30 ->willReturn(new ilCertificateTemplate(
31 100,
32 'crs',
33 '<xml> Some Content </xml>',
34 md5('<xml> Some Content </xml>'),
35 '[]',
36 3,
37 'v5.4.0',
38 123_456_789,
39 true,
40 '-',
41 '-',
42 50
43 ));
44
45 $irss = $this->getMockBuilder(IRSS::class)
46 ->disableOriginalConstructor()
47 ->getMock();
48
49 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
50 ->getMock();
51
52 $objectHelper->method('lookupType')
53 ->willReturn('crs');
54
55 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
56 ->disableOriginalConstructor()
57 ->getMock();
58
59 $utilHelper
60 ->expects($this->once())
61 ->method('zipAndDeliver');
62
64 100,
65 '/some/where/background.jpg',
66 $templateRepository,
67 $irss,
68 $objectHelper,
69 $utilHelper
70 );
71
72 $action->export('some/where/root', 'phpunit');
73 }
74}