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

Public Member Functions

 testGetter ()
 
 testInvalidTypeThrowsException ()
 
 testGetPluginsSlots ()
 
 testHasPluginSlotId ()
 
 testGetPluginSlotById ()
 
 testGetUnknownPluginSlotById ()
 
 testGetUnknownPluginSlot ()
 
 testHasPluginSlotName ()
 
 testGetPluginSlotByName ()
 
 testGetUnknownPluginSlotByName ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

ilComponentInfo $component
 
ilPluginSlotInfo $pluginslot1
 
ilPluginSlotInfo $pluginslot2
 

Detailed Description

Definition at line 21 of file ilComponentInfoTest.php.

Member Function Documentation

◆ setUp()

ilComponentInfoTest::setUp ( )
protected

Definition at line 27 of file ilComponentInfoTest.php.

References $pluginslot1, and $pluginslot2.

27  : void
28  {
29  $slots = [];
30 
31  $this->component = new ilComponentInfo(
32  "mod1",
33  "components/ILIAS",
34  "Module1",
35  $slots
36  );
37 
38  $plugins = [];
39  $this->pluginslot1 = new ilPluginSlotInfo(
40  $this->component,
41  "slt1",
42  "Slot1",
43  $plugins
44  );
45 
46  $this->pluginslot2 = new ilPluginSlotInfo(
47  $this->component,
48  "slt2",
49  "Slot2",
50  $plugins
51  );
52 
53  $slots[] = $this->pluginslot1;
54  $slots[] = $this->pluginslot2;
55  }
Simple value class for basic information about a pluginslot.
ilPluginSlotInfo $pluginslot1
ilPluginSlotInfo $pluginslot2
Simple value class for basic information about a component.

◆ testGetPluginSlotById()

ilComponentInfoTest::testGetPluginSlotById ( )

Definition at line 93 of file ilComponentInfoTest.php.

93  : void
94  {
95  $plugins = [];
96  $this->assertEquals(new ilPluginSlotInfo($this->component, "slt1", "Slot1", $plugins), $this->component->getPluginSlotById("slt1"));
97  $this->assertEquals(new ilPluginSlotInfo($this->component, "slt2", "Slot2", $plugins), $this->component->getPluginSlotById("slt2"));
98  }
Simple value class for basic information about a pluginslot.

◆ testGetPluginSlotByName()

ilComponentInfoTest::testGetPluginSlotByName ( )

Definition at line 119 of file ilComponentInfoTest.php.

119  : void
120  {
121  $plugins = [];
122  $this->assertEquals(new ilPluginSlotInfo($this->component, "slt1", "Slot1", $plugins), $this->component->getPluginSlotByName("Slot1"));
123  $this->assertEquals(new ilPluginSlotInfo($this->component, "slt2", "Slot2", $plugins), $this->component->getPluginSlotByName("Slot2"));
124  }
Simple value class for basic information about a pluginslot.

◆ testGetPluginsSlots()

ilComponentInfoTest::testGetPluginsSlots ( )

Definition at line 77 of file ilComponentInfoTest.php.

77  : void
78  {
79  $pluginslots = iterator_to_array($this->component->getPluginSlots());
80  $plugins = [];
81  $this->assertCount(2, $pluginslots);
82  $this->assertEquals(new ilPluginSlotInfo($this->component, "slt1", "Slot1", $plugins), $pluginslots["slt1"]);
83  $this->assertEquals(new ilPluginSlotInfo($this->component, "slt2", "Slot2", $plugins), $pluginslots["slt2"]);
84  }
Simple value class for basic information about a pluginslot.

◆ testGetter()

ilComponentInfoTest::testGetter ( )

Definition at line 57 of file ilComponentInfoTest.php.

57  : void
58  {
59  $this->assertEquals("mod1", $this->component->getId());
60  $this->assertEquals("components/ILIAS", $this->component->getType());
61  $this->assertEquals("Module1", $this->component->getName());
62  $this->assertEquals("components/ILIAS/Module1", $this->component->getQualifiedName());
63  }

◆ testGetUnknownPluginSlot()

ilComponentInfoTest::testGetUnknownPluginSlot ( )

Definition at line 106 of file ilComponentInfoTest.php.

106  : void
107  {
108  $this->expectException(\InvalidArgumentException::class);
109  $this->component->getPluginSlotById("slt3");
110  }

◆ testGetUnknownPluginSlotById()

ilComponentInfoTest::testGetUnknownPluginSlotById ( )

Definition at line 100 of file ilComponentInfoTest.php.

100  : void
101  {
102  $this->expectException(\InvalidArgumentException::class);
103  $this->component->getPluginSlotById("slt3");
104  }

◆ testGetUnknownPluginSlotByName()

ilComponentInfoTest::testGetUnknownPluginSlotByName ( )

Definition at line 126 of file ilComponentInfoTest.php.

126  : void
127  {
128  $this->expectException(\InvalidArgumentException::class);
129  $this->component->getPluginSlotById("Slot3");
130  }

◆ testHasPluginSlotId()

ilComponentInfoTest::testHasPluginSlotId ( )

Definition at line 86 of file ilComponentInfoTest.php.

86  : void
87  {
88  $this->assertTrue($this->component->hasPluginSlotId("slt1"));
89  $this->assertTrue($this->component->hasPluginSlotId("slt2"));
90  $this->assertFalse($this->component->hasPluginSlotId("slt3"));
91  }

◆ testHasPluginSlotName()

ilComponentInfoTest::testHasPluginSlotName ( )

Definition at line 112 of file ilComponentInfoTest.php.

112  : void
113  {
114  $this->assertTrue($this->component->hasPluginSlotName("Slot1"));
115  $this->assertTrue($this->component->hasPluginSlotName("Slot2"));
116  $this->assertFalse($this->component->hasPluginSlotName("Slot3"));
117  }

◆ testInvalidTypeThrowsException()

ilComponentInfoTest::testInvalidTypeThrowsException ( )

Definition at line 65 of file ilComponentInfoTest.php.

65  : void
66  {
67  $this->expectException(\InvalidArgumentException::class);
68  $slots = [];
69  new ilComponentInfo(
70  "id",
71  "SomeOtherType",
72  "name",
73  $slots
74  );
75  }
Simple value class for basic information about a component.

Field Documentation

◆ $component

ilComponentInfo ilComponentInfoTest::$component
protected

Definition at line 23 of file ilComponentInfoTest.php.

◆ $pluginslot1

ilPluginSlotInfo ilComponentInfoTest::$pluginslot1
protected

Definition at line 24 of file ilComponentInfoTest.php.

Referenced by setUp().

◆ $pluginslot2

ilPluginSlotInfo ilComponentInfoTest::$pluginslot2
protected

Definition at line 25 of file ilComponentInfoTest.php.

Referenced by setUp().


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