ILIAS  release_7 Revision v7.30-3-g800a261c036
ilCertificateTemplateDeleteActionTest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
10 {
11 $templateRepositoryMock = $this->getMockBuilder('ilCertificateTemplateRepository')
12 ->disableOriginalConstructor()
13 ->getMock();
14
15 $templateRepositoryMock
16 ->method('deleteTemplate')
17 ->with(100, 2000);
18
19 $templateRepositoryMock->method('activatePreviousCertificate')
20 ->with(2000)
21 ->willReturn(new ilCertificateTemplate(
22 2000,
23 'crs',
24 'something',
25 md5('something'),
26 '[]',
27 '1',
28 'v5.4.0',
29 1234567890,
30 true,
31 'samples/background.jpg'
32 ));
33
34 $templateRepositoryMock->expects($this->once())->method("deleteTemplate");
35 $templateRepositoryMock->expects($this->once())->method("save");
36
37 $utilHelper = $this->getMockBuilder('ilCertificateUtilHelper')
38 ->getMock();
39
40 $objectHelper = $this->getMockBuilder('ilCertificateObjectHelper')
41 ->getMock();
42
43 $objectHelper->method('lookUpType')
44 ->willReturn('crs');
45
47 $templateRepositoryMock,
48 __DIR__,
49 $utilHelper,
50 $objectHelper,
51 'v5.4.0'
52 );
53
54 $action->delete(100, 2000);
55 }
56}
An exception for terminatinating execution or to throw for unit testing.
Class ilCertificateBaseTestCase.