11 $database = $this->getMockBuilder(
'ilDBInterface')
12 ->disableOriginalConstructor()
16 ->expects($this->
once())
20 ->expects($this->
once())
25 ->expects($this->
once())
28 $certificateFactory = $this->getMockBuilder(
'ilCertificateFactory')
31 $oldCertficate = $this->getMockBuilder(
'ilCertificate')
32 ->disableOriginalConstructor()
35 $oldCertficate->method(
'getBackgroundImageThumbPath')
36 ->willReturn(
'/some/where/background.jpg');
39 $newCertficate = $this->getMockBuilder(
'ilCertificate')
40 ->disableOriginalConstructor()
43 $newCertficate->method(
'getBackgroundImageThumbPath')
44 ->willReturn(
'/some/where/background.jpg');
46 $certificateFactory->method(
'create')
47 ->willReturnOnConsecutiveCalls(
52 $templateRepository = $this->getMockBuilder(
'ilCertificateTemplateRepository')
53 ->disableOriginalConstructor()
56 $templateRepository->method(
'fetchCertificateTemplatesByObjId')
62 '<xml> Some Content </xml>',
63 md5(
'<xml> Some Content </xml>'),
69 '/some/where/background.jpg',
70 '/some/where/card_thumb.jpg',
76 '<xml> Some Content </xml>',
77 md5(
'<xml> Some Content </xml>'),
83 '/some/where/background.jpg',
84 '/some/where/card_thumb.jpg',
91 ->expects($this->exactly(2))
94 $fileSystem = $this->getMockBuilder(
'\ILIAS\Filesystem\Filesystem')
97 $fileSystem->method(
'has')
101 ->expects($this->exactly(6))
104 $logger = $this->getMockBuilder(
'ilLogger')
105 ->disableOriginalConstructor()
108 $objectHelper = $this->getMockBuilder(
'ilCertificateObjectHelper')
111 $objectHelper->method(
'lookupObjId')
123 $oldObject = $this->getMockBuilder(
'ilObject')
124 ->disableOriginalConstructor()
127 $oldObject->method(
'getType')
130 $oldObject->method(
'getId')
133 $newObject = $this->getMockBuilder(
'ilObject')
134 ->disableOriginalConstructor()
137 $newObject->method(
'getType')
140 $newObject->method(
'getId')
143 $cloneAction->cloneCertificate($oldObject, $newObject,
'v5.4.0',
'/some/web/dir');
if(!array_key_exists('StateId', $_REQUEST)) $id
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.