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