11 $logger = $this->getMockBuilder(
'ilLogger')
12 ->disableOriginalConstructor()
15 $pdfGenerator = $this->getMockBuilder(
'ilPdfGenerator')
16 ->disableOriginalConstructor()
17 ->setMethods(array(
'generateCurrentActiveCertificate'))
20 $pdfGenerator->method(
'generateCurrentActiveCertificate')
21 ->willReturn(
'Something');
23 $ilUtilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
26 $errorHandler = $this->getMockBuilder(
'ilErrorHandling')
27 ->disableOriginalConstructor()
38 $result = $pdfAction->createPDF(10, 200);
40 $this->assertEquals(
'Something',
$result);
45 $logger = $this->getMockBuilder(
'ilLogger')
46 ->disableOriginalConstructor()
49 $pdfGenerator = $this->getMockBuilder(
'ilPdfGenerator')
50 ->disableOriginalConstructor()
51 ->setMethods(array(
'generateCurrentActiveCertificate',
'generateFileName'))
54 $pdfGenerator->method(
'generateCurrentActiveCertificate')
55 ->willReturn(
'Something');
57 $pdfGenerator->method(
'generateFileName')
58 ->willReturn(
'some_file_name.pdf');
60 $ilUtilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
63 $ilUtilHelper->method(
'deliverData')
70 $errorHandler = $this->getMockBuilder(
'ilErrorHandling')
71 ->disableOriginalConstructor()
81 $result = $pdfAction->downloadPdf(10, 200);
83 $this->assertEquals(
'Something',
$result);
88 $logger = $this->getMockBuilder(
'ilLogger')
89 ->disableOriginalConstructor()
92 $pdfGenerator = $this->getMockBuilder(
'ilPdfGenerator')
93 ->disableOriginalConstructor()
94 ->setMethods(array(
'generateCurrentActiveCertificate',
'generateFileName'))
97 $pdfGenerator->method(
'generateCurrentActiveCertificate')
98 ->willReturn(
'Something');
100 $pdfGenerator->method(
'generateFileName')
101 ->willReturn(
'some_file_name.pdf');
103 $ilUtilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
106 $ilUtilHelper->method(
'deliverData')
109 'some_file_name.pdf',
115 $errorHandler = $this->getMockBuilder(
'ilErrorHandling')
119 ->expects($this->
once())
120 ->method(
'raiseError');
124 $result = $pdfAction->downloadPdf(10, 200);
126 $this->assertEquals(
'',
$result);
testDownloadResultsInExceptionBecauseTheServerIsNotActive()
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
Class ilRpcClientException.
testCreatePdfWillCreatedAndIsDownloadable()