ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCertificateTypeClassMapTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24
26{
28
29 protected function setUp(): void
30 {
31 parent::setUp();
32 $this->classMap = new ilCertificateTypeClassMap();
33 }
34
35 public function testFetchCoursePlaceHolderClass(): void
36 {
37 $class = $this->classMap->getPlaceHolderClassNameByType('crs');
38
39 $this->assertSame(CoursePlaceholderValues::class, $class);
40 }
41
42 public function testFetchTestPlaceHolderClass(): void
43 {
44 $class = $this->classMap->getPlaceHolderClassNameByType('tst');
45
46 $this->assertSame(TestPlaceholderValues::class, $class);
47 }
48
49 public function testFetchExercisePlaceHolderClass(): void
50 {
51 $class = $this->classMap->getPlaceHolderClassNameByType('exc');
52
53 $this->assertSame(ExercisePlaceholderValues::class, $class);
54 }
55
56 public function testFetchScormPlaceHolderClass(): void
57 {
58 $class = $this->classMap->getPlaceHolderClassNameByType('sahs');
59
60 $this->assertSame(ilScormPlaceholderValues::class, $class);
61 }
62
64 {
65 $this->expectException(ilException::class);
66
67 $this->classMap->getPlaceHolderClassNameByType('something');
68
69 $this->fail('Should never happen. No Exception thrown?');
70 }
71
72 public function testIsCourseExisting(): void
73 {
74 $result = $this->classMap->typeExistsInMap('crs');
75
76 $this->assertTrue($result);
77 }
78
79 public function testIsTestExisting(): void
80 {
81 $result = $this->classMap->typeExistsInMap('tst');
82
83 $this->assertTrue($result);
84 }
85
86 public function testIsExerciseExisting(): void
87 {
88 $result = $this->classMap->typeExistsInMap('exc');
89
90 $this->assertTrue($result);
91 }
92
93 public function testUnknownTypeIsNotExisting(): void
94 {
95 $result = $this->classMap->typeExistsInMap('something');
96
97 $this->assertFalse($result);
98 }
99}