ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PCDefinitionTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\COPage\Test\PC;
22
23use PHPUnit\Framework\TestCase;
24
29{
30 public function testGetPCDefinitionByType(): void
31 {
32 $def = $this->getPCDefinition();
33 $pc_def = $def->getPCDefinitionByType("par");
34
35 $this->assertEquals(
36 "Paragraph",
37 $pc_def["name"]
38 );
39 }
40
41 public function testGetPCDefinitionByName(): void
42 {
43 $def = $this->getPCDefinition();
44 $pc_def = $def->getPCDefinitionByName("Paragraph");
45
46 $this->assertEquals(
47 "par",
48 $pc_def["pc_type"]
49 );
50 }
51
52 public function testGetPCDefinitionByGUIClassName(): void
53 {
54 $def = $this->getPCDefinition();
55 $pc_def = $def->getPCDefinitionByGUIClassName("ilPCParagraphGUI");
56
57 $this->assertEquals(
58 "par",
59 $pc_def["pc_type"]
60 );
61 }
62
63 public function testIsPCGUIClassName(): void
64 {
65 $def = $this->getPCDefinition();
66
67 $this->assertEquals(
68 true,
69 $def->isPCGUIClassName("ilPCParagraphGUI")
70 );
71
72 $this->assertEquals(
73 false,
74 $def->isPCGUIClassName("xyz")
75 );
76 }
77
78 public function testGetPCEditorInstanceByName(): void
79 {
80 $def = $this->getPCDefinition();
81 $pc_ed = $def->getPCEditorInstanceByName("Paragraph");
82
83 $this->assertEquals(
84 "ilPCParagraphEditorGUI",
85 get_class($pc_ed)
86 );
87 }
88}