11 $fileUpload = $this->getMockBuilder(
'\ILIAS\FileUpload\FileUpload')
12 ->disableOriginalConstructor()
15 $fileUpload->method(
'hasBeenProcessed')
18 $fileUpload->expects($this->
once())
21 $fileUpload->method(
'hasUploads')
24 $uploadResult = new \ILIAS\FileUpload\DTO\UploadResult(
28 $this->getMockBuilder(\
ILIAS\FileUpload\Collection\ImmutableStringMap::class)->getMock(),
29 new \
ILIAS\FileUpload\DTO\ProcessingStatus(\
ILIAS\FileUpload\DTO\ProcessingStatus::OK,
'uploaded'),
33 $fileUpload->method(
'getResults')
34 ->willReturn(array(
"some/where/temporary" => $uploadResult));
36 $fileUpload->expects($this->
once())
37 ->method(
'moveOneFileTo');
39 $language = $this->getMockBuilder(
'ilLanguage')
40 ->disableOriginalConstructor()
43 $logger = $this->getMockBuilder(
'ilLogger')
44 ->disableOriginalConstructor()
47 $fileSystem = $this->getMockBuilder(
'\ILIAS\Filesystem\Filesystem')
48 ->disableOriginalConstructor()
51 $fileSystem->method(
'hasDir')
54 $fileSystem->method(
'has')
57 $fileSystem->expects($this->
once())
60 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
63 $utilHelper->expects($this->exactly(2))
64 ->method(
'convertImage');
66 $fileUtilsHelper = $this->getMockBuilder(
'ilCertificateFileUtilsHelper')
69 $legacyPathHelper = $this->getMockBuilder(
'LegacyPathHelperHelper')
72 $legacyPathHelper->method(
'createRelativePath')
73 ->willReturn(
'the/relative/path');
77 'certifcate/path/to/some/where',
84 'Some Root Directory',
88 $upload->uploadBackgroundImage(
'some/where/temporary',
'3');
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.