ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCertificateTemplateDeleteActionTest Class Reference
+ Inheritance diagram for ilCertificateTemplateDeleteActionTest:
+ Collaboration diagram for ilCertificateTemplateDeleteActionTest:

Public Member Functions

 testDeleteTemplateAndUseOldThumbnail ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilCertificateBaseTestCase
 setUp ()
 
 tearDown ()
 
 assertDoesNotThrow (callable $cb, string $message='')
 
 assertThrows (callable $cb, ?string $expected_class=null, ?string $expected_message=null)
 @template T of Throwable More...
 
 setGlobalVariable (string $name, mixed $value)
 
- Protected Attributes inherited from ilCertificateBaseTestCase
Container $dic
 

Detailed Description

Definition at line 21 of file ilCertificateTemplateDeleteActionTest.php.

Member Function Documentation

◆ testDeleteTemplateAndUseOldThumbnail()

ilCertificateTemplateDeleteActionTest::testDeleteTemplateAndUseOldThumbnail ( )

Definition at line 23 of file ilCertificateTemplateDeleteActionTest.php.

23 : void
24 {
25 $templateRepositoryMock = $this->getMockBuilder(ilCertificateTemplateRepository::class)
26 ->disableOriginalConstructor()
27 ->getMock();
28
29 $templateRepositoryMock
30 ->method('deleteTemplate')
31 ->with(100, 2000);
32
33 $templateRepositoryMock->method('activatePreviousCertificate')
34 ->with(2000)
35 ->willReturn(new ilCertificateTemplate(
36 2000,
37 'crs',
38 'something',
39 md5('something'),
40 '[]',
41 1,
42 'v5.4.0',
43 1_234_567_890,
44 true,
45 'samples/background.jpg',
46 '',
47 '-',
48 '-'
49 ));
50
51 $templateRepositoryMock->expects($this->once())->method("deleteTemplate");
52 $templateRepositoryMock->expects($this->once())->method("save");
53
54 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
55 ->disableOriginalConstructor()
56 ->getMock();
57
58 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
59 ->getMock();
60
61 $objectHelper->method('lookUpType')
62 ->willReturn('crs');
63
65 $templateRepositoryMock,
66 'v5.4.0',
67 $objectHelper
68 );
69
70 $action->delete(100, 2000);
71 }

The documentation for this class was generated from the following file: