ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilComponentDefinitionInfoProcessorTest Class Reference
+ Inheritance diagram for ilComponentDefinitionInfoProcessorTest:
+ Collaboration diagram for ilComponentDefinitionInfoProcessorTest:

Public Member Functions

 testPurge ()
 
 testBeginTag ()
 
 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 = "components/ILIAS";
46  $name1 = "NAME1";
47  $id1 = "ID1";
48  $name2 = "NAME2";
49  $id2 = "ID2";
50 
51  $type2 = "components/ILIAS";
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 100 of file ilComponentDefinitionInfoProcessorTest.php.

100  : void
101  {
102  $this->expectException(\LogicException::class);
103 
104  $this->processor->beginComponent("Module1", "components/ILIAS");
105  $this->processor->beginTag("module", ["id" => "id"]);
106 
107  $this->processor->beginComponent("Module2", "components/ILIAS");
108  $this->processor->beginTag("module", ["id" => "id"]);
109  }

◆ testDuplicatePluginId()

ilComponentDefinitionInfoProcessorTest::testDuplicatePluginId ( )

Definition at line 111 of file ilComponentDefinitionInfoProcessorTest.php.

111  : void
112  {
113  $this->expectException(\LogicException::class);
114 
115  $this->processor->beginComponent("Module1", "components/ILIAS");
116  $this->processor->beginTag("module", ["id" => "id1"]);
117  $this->processor->beginTag("pluginslot", ["id" => "id", "name" => "name"]);
118 
119  $this->processor->beginComponent("Module2", "components/ILIAS");
120  $this->processor->beginTag("module", ["id" => "id2"]);
121  $this->processor->beginTag("pluginslot", ["id" => "id", "name" => "name"]);
122  }

◆ testMissingId()

ilComponentDefinitionInfoProcessorTest::testMissingId ( )

Definition at line 89 of file ilComponentDefinitionInfoProcessorTest.php.

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

◆ testPurge()

ilComponentDefinitionInfoProcessorTest::testPurge ( )

Definition at line 30 of file ilComponentDefinitionInfoProcessorTest.php.

References $id.

30  : void
31  {
32  $type = "components/ILIAS";
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

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: