3 include_once(
"Services/Style/System/classes/Icons/class.ilSystemStyleIconColor.php");
4 include_once(
"Services/Style/System/classes/Icons/class.ilSystemStyleIconColorSet.php");
5 include_once(
"Services/Style/System/classes/Exceptions/class.ilSystemStyleColorException.php");
6 include_once(
"Services/Style/System/classes/Exceptions/class.ilSystemStyleException.php");
20 $this->assertEquals([], $set->getColors());
30 $this->assertEquals([], $set->getColors());
32 $set->addColor($color1);
34 $this->assertEquals(1, count($set->getColors()));
35 $this->assertEquals($color1, $set->getColorById(
"id1"));
37 $set->addColor($color2);
38 $this->assertEquals(2, count($set->getColors()));
39 $this->assertEquals($color1, $set->getColorById(
"id1"));
40 $this->assertEquals($color2, $set->getColorById(
"id2"));
42 $set->addColor($color2);
43 $this->assertEquals(2, count($set->getColors()));
44 $this->assertEquals($color1, $set->getColorById(
"id1"));
45 $this->assertEquals($color2, $set->getColorById(
"id2"));
52 $set->addColor($color1);
55 $set->getColorById(
"idXY");
56 $this->assertTrue(
false);
66 $set->addColor($color1);
68 $this->assertTrue($set->doesColorExist(
"id1"));
69 $this->assertFalse($set->doesColorExist(
"otherId"));
70 $this->assertFalse($set->doesColorExist(
""));
82 $set1->addColor($color1);
83 $set1->addColor($color2);
85 $set2->addColor($color2);
86 $set2->addColor($color3);
88 $set1->mergeColorSet($set2);
90 $this->assertEquals(3, count($set1->getColors()));
91 $this->assertEquals($color1, $set1->getColorById(
"id1"));
92 $this->assertEquals($color2, $set1->getColorById(
"id2"));
93 $this->assertEquals($color3, $set1->getColorById(
"id3"));
95 $this->assertEquals(2, count($set2->getColors()));
96 $this->assertEquals($color2, $set2->getColorById(
"id2"));
97 $this->assertEquals($color3, $set2->getColorById(
"id3"));
121 $set1->addColor($grey);
122 $set1->addColor(
$red);
124 $set1->addColor(
$blue);
126 $this->assertEquals($ordered_array, $set1->getColorsSortedAsArray());
139 $as_array = [
"id1",
"id2",
"id3",
"id4",
"id5",
"id6"];
145 $set1->addColor($grey);
146 $set1->addColor(
$red);
148 $set1->addColor(
$blue);
150 $this->assertEquals($as_array, $set1->asArray());
163 $as_string =
"id1; id2; id3; id4; id5; id6; ";
169 $set1->addColor($grey);
170 $set1->addColor(
$red);
172 $set1->addColor(
$blue);
174 $this->assertEquals($as_string, $set1->asString());
testGetColorsSortedAsArray()
Class for advanced editing exception handling in ILIAS.