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