ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPdfGeneratorTest Class Reference
+ Inheritance diagram for ilPdfGeneratorTest:
+ Collaboration diagram for ilPdfGeneratorTest:

Public Member Functions

 testGenerateSpecificCertificate ()
 
 testGenerateCurrentActiveCertificate ()
 

Detailed Description

Author
Niels Theen nthee.nosp@m.n@da.nosp@m.tabay.nosp@m..de

Definition at line 7 of file ilPdfGeneratorTest.php.

Member Function Documentation

◆ testGenerateCurrentActiveCertificate()

ilPdfGeneratorTest::testGenerateCurrentActiveCertificate ( )

Definition at line 62 of file ilPdfGeneratorTest.php.

References $certificate.

63  {
64  if (!defined('CLIENT_WEB_DIR')) {
65  define("CLIENT_WEB_DIR", 'my/client/web/dir');
66  }
68  3,
69  20,
70  'crs',
71  50,
72  'ilyas',
73  123456789,
74  '<xml> Some content </xml>',
75  '[]',
76  null,
77  '3',
78  'v5.4.0',
79  true,
80  '/some/where/background.jpg',
81  300
82  );
83 
84  $userCertificateRepository = $this->getMockBuilder('ilUserCertificateRepository')
85  ->disableOriginalConstructor()
86  ->getMock();
87 
88  $userCertificateRepository->method('fetchActiveCertificate')
89  ->willReturn($certificate);
90 
91  $logger = $this->getMockBuilder('ilLogger')
92  ->disableOriginalConstructor()
93  ->getMock();
94 
95  $rpcHelper = $this->getMockBuilder('ilCertificateRpcClientFactoryHelper')
96  ->getMock();
97 
98  $rpcHelper->method('ilFO2PDF')
99  ->willReturn(new ScalarPdf());
100 
101  $pdfFileNameFactory = $this->getMockBuilder('ilCertificatePdfFileNameFactory')
102  ->disableOriginalConstructor()
103  ->getMock();
104 
105  $pdfGenerator = new ilPdfGenerator(
106  $userCertificateRepository,
107  $logger,
108  $rpcHelper,
109  $pdfFileNameFactory
110  );
111 
112  $pdfGenerator->generateCurrentActiveCertificate(100, 200);
113  }
Class ilPdfGeneratorConstantsTest.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77

◆ testGenerateSpecificCertificate()

ilPdfGeneratorTest::testGenerateSpecificCertificate ( )

Definition at line 9 of file ilPdfGeneratorTest.php.

References $certificate.

10  {
11  if (!defined('CLIENT_WEB_DIR')) {
12  define("CLIENT_WEB_DIR", 'my/client/web/dir');
13  }
15  3,
16  20,
17  'crs',
18  50,
19  'ilyas',
20  123456789,
21  '<xml> Some content </xml>',
22  '[]',
23  null,
24  '3',
25  'v5.4.0',
26  true,
27  '/some/where/background.jpg',
28  300
29  );
30 
31  $userCertificateRepository = $this->getMockBuilder('ilUserCertificateRepository')
32  ->disableOriginalConstructor()
33  ->getMock();
34 
35  $userCertificateRepository->method('fetchCertificate')
36  ->willReturn($certificate);
37 
38  $logger = $this->getMockBuilder('ilLogger')
39  ->disableOriginalConstructor()
40  ->getMock();
41 
42  $rpcHelper = $this->getMockBuilder('ilCertificateRpcClientFactoryHelper')
43  ->getMock();
44 
45  $rpcHelper->method('ilFO2PDF')
46  ->willReturn(new ScalarPdf());
47 
48  $pdfFileNameFactory = $this->getMockBuilder('ilCertificatePdfFileNameFactory')
49  ->disableOriginalConstructor()
50  ->getMock();
51 
52  $pdfGenerator = new ilPdfGenerator(
53  $userCertificateRepository,
54  $logger,
55  $rpcHelper,
56  $pdfFileNameFactory
57  );
58 
59  $pdfGenerator->generate(100);
60  }
Class ilPdfGeneratorConstantsTest.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77

The documentation for this class was generated from the following file: