ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 '-',
46 '-'
47 ));
48
49 $templateRepositoryMock->expects($this->once())->method("deleteTemplate");
50 $templateRepositoryMock->expects($this->once())->method("save");
51
52 $utilHelper = $this->getMockBuilder(ilCertificateUtilHelper::class)
53 ->disableOriginalConstructor()
54 ->getMock();
55
56 $objectHelper = $this->getMockBuilder(ilCertificateObjectHelper::class)
57 ->getMock();
58
59 $objectHelper->method('lookUpType')
60 ->willReturn('crs');
61
63 $templateRepositoryMock,
64 'v5.4.0',
65 $objectHelper
66 );
67
68 $action->delete(100, 2000);
69 }

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