ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 22 of file ilComponentInfoTest.php.

Member Function Documentation

◆ setUp()

ilComponentInfoTest::setUp ( )
protected

Definition at line 28 of file ilComponentInfoTest.php.

References $pluginslot1, and $pluginslot2.

28  : void
29  {
30  $slots = [];
31 
32  $this->component = new ilComponentInfo(
33  "mod1",
34  "components/ILIAS",
35  "Module1",
36  $slots
37  );
38 
39  $plugins = [];
40  $this->pluginslot1 = new ilPluginSlotInfo(
41  $this->component,
42  "slt1",
43  "Slot1",
44  $plugins
45  );
46 
47  $this->pluginslot2 = new ilPluginSlotInfo(
48  $this->component,
49  "slt2",
50  "Slot2",
51  $plugins
52  );
53 
54  $slots[] = $this->pluginslot1;
55  $slots[] = $this->pluginslot2;
56  }
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 94 of file ilComponentInfoTest.php.

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

◆ testGetPluginSlotByName()

ilComponentInfoTest::testGetPluginSlotByName ( )

Definition at line 120 of file ilComponentInfoTest.php.

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

◆ testGetPluginsSlots()

ilComponentInfoTest::testGetPluginsSlots ( )

Definition at line 78 of file ilComponentInfoTest.php.

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

◆ testGetter()

ilComponentInfoTest::testGetter ( )

Definition at line 58 of file ilComponentInfoTest.php.

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

◆ testGetUnknownPluginSlot()

ilComponentInfoTest::testGetUnknownPluginSlot ( )

Definition at line 107 of file ilComponentInfoTest.php.

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

◆ testGetUnknownPluginSlotById()

ilComponentInfoTest::testGetUnknownPluginSlotById ( )

Definition at line 101 of file ilComponentInfoTest.php.

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

◆ testGetUnknownPluginSlotByName()

ilComponentInfoTest::testGetUnknownPluginSlotByName ( )

Definition at line 127 of file ilComponentInfoTest.php.

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

◆ testHasPluginSlotId()

ilComponentInfoTest::testHasPluginSlotId ( )

Definition at line 87 of file ilComponentInfoTest.php.

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

◆ testHasPluginSlotName()

ilComponentInfoTest::testHasPluginSlotName ( )

Definition at line 113 of file ilComponentInfoTest.php.

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

◆ testInvalidTypeThrowsException()

ilComponentInfoTest::testInvalidTypeThrowsException ( )

Definition at line 66 of file ilComponentInfoTest.php.

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

Field Documentation

◆ $component

ilComponentInfo ilComponentInfoTest::$component
protected

Definition at line 24 of file ilComponentInfoTest.php.

◆ $pluginslot1

ilPluginSlotInfo ilComponentInfoTest::$pluginslot1
protected

Definition at line 25 of file ilComponentInfoTest.php.

Referenced by setUp().

◆ $pluginslot2

ilPluginSlotInfo ilComponentInfoTest::$pluginslot2
protected

Definition at line 26 of file ilComponentInfoTest.php.

Referenced by setUp().


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