11 $templateRepository = $this->getMockBuilder(
'ilCertificateTemplateRepository')
12 ->disableOriginalConstructor()
15 $placeholderValuesObject = $this->getMockBuilder(
'ilCertificatePlaceholderValues')
16 ->disableOriginalConstructor()
19 $placeholderValuesObject->method(
'getPlaceholderValuesForPreview')
21 'USER_LOGIN' =>
'SomeLogin',
22 'USER_FULLNAME' =>
'SomeFullName',
23 'USER_FIRSTNAME' =>
'SomeFirstName' 26 $logger = $this->getMockBuilder(
'ilLogger')
27 ->disableOriginalConstructor()
30 $user = $this->getMockBuilder(
'ilObjUser')
31 ->disableOriginalConstructor()
34 $user->method(
'getId')
37 $utilHelper = $this->getMockBuilder(
'ilCertificateUtilHelper')
41 ->expects($this->
once())
42 ->method(
'deliverData');
44 $mathJaxHelper = $this->getMockBuilder(
'ilCertificateMathJaxHelper')
47 $mathJaxHelper->method(
'fillXlsFoContent')
48 ->willReturn(
'<xml> Some filled XML content </xml>');
50 $userDefinedFieldsHelper = $this->getMockBuilder(
'ilCertificateUserDefinedFieldsHelper')
53 $definitionsMock = $this->getMockBuilder(
'ilUserDefinedFields')
54 ->disableOriginalConstructor()
57 $definitionsMock->method(
'getDefinitions')
61 'certificate' =>
true,
63 'field_name' =>
'Some Field Name',
68 $userDefinedFieldsHelper->method(
'createInstance')
69 ->willReturn($definitionsMock);
71 $rpcClientFactoryHelper = $this->getMockBuilder(
'ilCertificateRpcClientFactoryHelper')
74 $mock = $this->getMockBuilder(
'StdClass')
75 ->disableOriginalConstructor()
78 $mock->scalar =
'<xml> Some XML content </xml>';
80 $rpcClientFactoryHelper->method(
'ilFO2PDF')
87 $placeholderValuesObject,
92 $userDefinedFieldsHelper,
93 $rpcClientFactoryHelper,
97 $previewAction->createPreviewPdf(100);
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.