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");
19 $this->assertEquals([],$set->getColors());
28 $this->assertEquals([],$set->getColors());
30 $set->addColor($color1);
32 $this->assertEquals(1,count($set->getColors()));
33 $this->assertEquals($color1,$set->getColorById(
"id1"));
35 $set->addColor($color2);
36 $this->assertEquals(2,count($set->getColors()));
37 $this->assertEquals($color1,$set->getColorById(
"id1"));
38 $this->assertEquals($color2,$set->getColorById(
"id2"));
40 $set->addColor($color2);
41 $this->assertEquals(2,count($set->getColors()));
42 $this->assertEquals($color1,$set->getColorById(
"id1"));
43 $this->assertEquals($color2,$set->getColorById(
"id2"));
49 $set->addColor($color1);
52 $set->getColorById(
"idXY");
53 $this->assertTrue(
false);
63 $set->addColor($color1);
65 $this->assertTrue($set->doesColorExist(
"id1"));
66 $this->assertFalse($set->doesColorExist(
"otherId"));
67 $this->assertFalse($set->doesColorExist(
""));
78 $set1->addColor($color1);
79 $set1->addColor($color2);
81 $set2->addColor($color2);
82 $set2->addColor($color3);
84 $set1->mergeColorSet($set2);
86 $this->assertEquals(3,count($set1->getColors()));
87 $this->assertEquals($color1,$set1->getColorById(
"id1"));
88 $this->assertEquals($color2,$set1->getColorById(
"id2"));
89 $this->assertEquals($color3,$set1->getColorById(
"id3"));
91 $this->assertEquals(2,count($set2->getColors()));
92 $this->assertEquals($color2,$set2->getColorById(
"id2"));
93 $this->assertEquals($color3,$set2->getColorById(
"id3"));
116 $set1->addColor($grey);
117 $set1->addColor(
$red);
119 $set1->addColor(
$blue);
121 $this->assertEquals($ordered_array,$set1->getColorsSortedAsArray());
133 $as_array = [
"id1",
"id2",
"id3",
"id4",
"id5",
"id6"];
139 $set1->addColor($grey);
140 $set1->addColor(
$red);
142 $set1->addColor(
$blue);
144 $this->assertEquals($as_array,$set1->asArray());
156 $as_string =
"id1; id2; id3; id4; id5; id6; ";
162 $set1->addColor($grey);
163 $set1->addColor(
$red);
165 $set1->addColor(
$blue);
167 $this->assertEquals($as_string,$set1->asString());
testGetColorsSortedAsArray()
Class for advanced editing exception handling in ILIAS.