ILIAS  release_8 Revision v8.24
ilComponentDefinitionInfoProcessorTest Class Reference
+ Inheritance diagram for ilComponentDefinitionInfoProcessorTest:
+ Collaboration diagram for ilComponentDefinitionInfoProcessorTest:

Public Member Functions

 testPurge ()
 
 testBeginTag ()
 
 testTagComponentTypeMismatch ()
 
 testMissingId ()
 
 testDuplicateComponentId ()
 
 testDuplicatePluginId ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

ilComponentInfoDefinitionProcessor $processor
 

Detailed Description

Definition at line 21 of file ilComponentDefinitionInfoProcessorTest.php.

Member Function Documentation

◆ setUp()

ilComponentDefinitionInfoProcessorTest::setUp ( )
protected

◆ testBeginTag()

ilComponentDefinitionInfoProcessorTest::testBeginTag ( )

Definition at line 43 of file ilComponentDefinitionInfoProcessorTest.php.

43 : void
44 {
45 $type1 = "Modules";
46 $name1 = "NAME1";
47 $id1 = "ID1";
48 $name2 = "NAME2";
49 $id2 = "ID2";
50
51 $type2 = "Services";
52 $name3 = "NAME3";
53 $id3 = "ID3";
54 $name4 = "NAME4";
55 $id4 = "ID4";
56
57 $id5 = "id5";
58 $name5 = "name5";
59 $id6 = "id6";
60 $name6 = "name6";
61 $id7 = "id7";
62 $name7 = "name7";
63
64 $this->processor->beginComponent($name1, $type1);
65 $this->processor->beginTag("module", ["id" => $id1]);
66
67 $this->processor->beginComponent($name2, $type1);
68 $this->processor->beginTag("module", ["id" => $id2]);
69 $this->processor->beginTag("pluginslot", ["id" => $id5, "name" => $name5]);
70
71 $this->processor->beginComponent($name3, $type2);
72 $this->processor->beginTag("service", ["id" => $id3]);
73 $this->processor->beginTag("pluginslot", ["id" => $id6, "name" => $name6]);
74 $this->processor->beginTag("pluginslot", ["id" => $id7, "name" => $name7]);
75
76 $this->processor->beginComponent($name4, $type2);
77 $this->processor->beginTag("service", ["id" => $id4]);
78
79 $expected = [
80 $id1 => [$type1, $name1, []],
81 $id2 => [$type1, $name2, [[$id5, $name5]]],
82 $id3 => [$type2, $name3, [[$id6, $name6], [$id7, $name7]]],
83 $id4 => [$type2, $name4, []]
84 ];
85
86 $this->assertEquals($expected, $this->processor->getData());
87 }

◆ testDuplicateComponentId()

ilComponentDefinitionInfoProcessorTest::testDuplicateComponentId ( )

Definition at line 112 of file ilComponentDefinitionInfoProcessorTest.php.

112 : void
113 {
114 $this->expectException(\LogicException::class);
115
116 $this->processor->beginComponent("Module1", "Modules");
117 $this->processor->beginTag("module", ["id" => "id"]);
118
119 $this->processor->beginComponent("Module2", "Modules");
120 $this->processor->beginTag("module", ["id" => "id"]);
121 }

◆ testDuplicatePluginId()

ilComponentDefinitionInfoProcessorTest::testDuplicatePluginId ( )

Definition at line 123 of file ilComponentDefinitionInfoProcessorTest.php.

123 : void
124 {
125 $this->expectException(\LogicException::class);
126
127 $this->processor->beginComponent("Module1", "Modules");
128 $this->processor->beginTag("module", ["id" => "id1"]);
129 $this->processor->beginTag("pluginslot", ["id" => "id", "name" => "name"]);
130
131 $this->processor->beginComponent("Module2", "Modules");
132 $this->processor->beginTag("module", ["id" => "id2"]);
133 $this->processor->beginTag("pluginslot", ["id" => "id", "name" => "name"]);
134 }

◆ testMissingId()

ilComponentDefinitionInfoProcessorTest::testMissingId ( )

Definition at line 101 of file ilComponentDefinitionInfoProcessorTest.php.

101 : void
102 {
103 $this->expectException(\InvalidArgumentException::class);
104
105 $type = "Services";
106 $name = "NAME";
107
108 $this->processor->beginComponent($name, $type);
109 $this->processor->beginTag("service", []);
110 }
if($format !==null) $name
Definition: metadata.php:247
$type

References $name, and $type.

◆ testPurge()

ilComponentDefinitionInfoProcessorTest::testPurge ( )

Definition at line 30 of file ilComponentDefinitionInfoProcessorTest.php.

30 : void
31 {
32 $type = "Modules";
33 $name = "NAME";
34 $id = "ID";
35
36 $this->processor->beginComponent($name, $type);
37 $this->processor->beginTag("module", ["id" => $id]);
38 $this->processor->purge();
39
40 $this->assertEquals([], $this->processor->getData());
41 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, $name, and $type.

◆ testTagComponentTypeMismatch()

ilComponentDefinitionInfoProcessorTest::testTagComponentTypeMismatch ( )

Definition at line 89 of file ilComponentDefinitionInfoProcessorTest.php.

89 : void
90 {
91 $this->expectException(\InvalidArgumentException::class);
92
93 $type = "Services";
94 $name = "NAME";
95 $id = "ID";
96
97 $this->processor->beginComponent($name, $type);
98 $this->processor->beginTag("module", ["id" => $id]);
99 }

References $id, $name, and $type.

Field Documentation

◆ $processor

ilComponentInfoDefinitionProcessor ilComponentDefinitionInfoProcessorTest::$processor
protected

Definition at line 23 of file ilComponentDefinitionInfoProcessorTest.php.


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