11 $placeholderDescriptionObject = $this->getMockBuilder(
'ilCertificatePlaceholderDescription')
14 $logger = $this->getMockBuilder(
'ilLogger')
15 ->disableOriginalConstructor()
18 $filesystem = $this->getMockBuilder(
'ILIAS\Filesystem\Filesystem')
22 ->expects($this->never())
23 ->method(
'deleteDir');
25 $templateRepository = $this->getMockBuilder(
'ilCertificateTemplateRepository')
26 ->disableOriginalConstructor()
29 $objectHelper = $this->getMockBuilder(
'ilCertificateObjectHelper')
32 $objectHelper->method(
'lookupType')
35 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
39 ->method(
'moveUploadedFile')
43 ->expects($this->
once())
51 'entry' =>
'background.jpg' 55 'entry' =>
'certificate.xml' 60 ->expects($this->
once())
61 ->method(
'convertImage');
63 $database = $this->getMockBuilder(
'ilDBInterface')
64 ->disableOriginalConstructor()
69 'some/path/certiicate.xml',
70 $placeholderDescriptionObject,
88 $this->assertEquals(
true,
$result);
93 $placeholderDescriptionObject = $this->getMockBuilder(
'ilCertificatePlaceholderDescription')
96 $logger = $this->getMockBuilder(
'ilLogger')
97 ->disableOriginalConstructor()
100 $filesystem = $this->getMockBuilder(
'ILIAS\Filesystem\Filesystem')
104 ->expects($this->never())
105 ->method(
'deleteDir');
107 $templateRepository = $this->getMockBuilder(
'ilCertificateTemplateRepository')
108 ->disableOriginalConstructor()
111 $objectHelper = $this->getMockBuilder(
'ilCertificateObjectHelper')
114 $objectHelper->method(
'lookupType')
117 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
121 ->method(
'moveUploadedFile')
125 ->expects($this->
once())
133 'entry' =>
'certificate.xml' 137 $database = $this->getMockBuilder(
'ilDBInterface')
138 ->disableOriginalConstructor()
143 'some/path/certiicate.xml',
144 $placeholderDescriptionObject,
162 $this->assertEquals(
true,
$result);
167 $placeholderDescriptionObject = $this->getMockBuilder(
'ilCertificatePlaceholderDescription')
170 $logger = $this->getMockBuilder(
'ilLogger')
171 ->disableOriginalConstructor()
174 $filesystem = $this->getMockBuilder(
'ILIAS\Filesystem\Filesystem')
178 ->expects($this->
once())
179 ->method(
'deleteDir');
181 $templateRepository = $this->getMockBuilder(
'ilCertificateTemplateRepository')
182 ->disableOriginalConstructor()
185 $objectHelper = $this->getMockBuilder(
'ilCertificateObjectHelper')
188 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
192 ->method(
'moveUploadedFile')
196 ->expects($this->
once())
201 ->willReturn(array());
203 $database = $this->getMockBuilder(
'ilDBInterface')
204 ->disableOriginalConstructor()
209 'some/path/certiicate.xml',
210 $placeholderDescriptionObject,
227 $this->assertEquals(
false,
$result);
232 $placeholderDescriptionObject = $this->getMockBuilder(
'ilCertificatePlaceholderDescription')
233 ->disableOriginalConstructor()
236 $logger = $this->getMockBuilder(
'ilLogger')
237 ->disableOriginalConstructor()
240 $filesystem = $this->getMockBuilder(
'ILIAS\Filesystem\Filesystem')
244 ->expects($this->
once())
245 ->method(
'deleteDir');
247 $templateRepository = $this->getMockBuilder(
'ilCertificateTemplateRepository')
248 ->disableOriginalConstructor()
251 $objectHelper = $this->getMockBuilder(
'ilCertificateObjectHelper')
254 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
258 ->method(
'moveUploadedFile')
261 $database = $this->getMockBuilder(
'ilDBInterface')
262 ->disableOriginalConstructor()
267 'some/path/certiicate.xml',
268 $placeholderDescriptionObject,
286 $this->assertEquals(
false,
$result);
testZipfileCouldNoBeMoved()
testCertificateCanBeImportedWithBackgroundImage()
testCertificateCanBeImportedWithoutBackgroundImage()
testNoXmlFileInUplodadZipFolder()
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.