◆ setUp()
ilSystemStyleIconFolderTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 49 of file ilSystemStyleIconFolderTest.php.
References $DIC, ilSystemStyleSkinContainer\generateFromId(), and ilSystemStyleSkinContainer\xCopy().
53 $this->save_dic =
$DIC;
58 mkdir($this->system_style_config->test_skin_temp_path);
62 $this->style = $this->container->getSkin()->getStyle(
"style1");
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
static xCopy($src, $dest)
Recursive copy of a folder.
◆ tearDown()
ilSystemStyleIconFolderTest::tearDown |
( |
| ) |
|
|
protected |
◆ testConstruct()
ilSystemStyleIconFolderTest::testConstruct |
( |
| ) |
|
Definition at line 73 of file ilSystemStyleIconFolderTest.php.
77 $this->assertEquals($this->container->getImagesSkinPath($this->style->getId()), $folder->getPath());
Abstracts a folder containing a set of icons.
◆ testExtractChangeColors()
ilSystemStyleIconFolderTest::testExtractChangeColors |
( |
| ) |
|
Definition at line 214 of file ilSystemStyleIconFolderTest.php.
217 $folder1->changeIconColors([
"505050" =>
"555555"]);
230 $expected_color_set->addColor($color2);
231 $expected_color_set->addColor($color3);
232 $expected_color_set->addColor($color4);
233 $expected_color_set->addColor($color5);
234 $expected_color_set->addColor($color6);
235 $expected_color_set->addColor($color1);
236 $expected_color_set->addColor($color7);
238 $this->assertEquals($expected_color_set, $folder2->getColorSet());
Abstracts a folder containing a set of icons.
◆ testExtractColorset()
ilSystemStyleIconFolderTest::testExtractColorset |
( |
| ) |
|
Definition at line 190 of file ilSystemStyleIconFolderTest.php.
203 $expected_color_set->addColor($color1);
204 $expected_color_set->addColor($color2);
205 $expected_color_set->addColor($color3);
206 $expected_color_set->addColor($color4);
207 $expected_color_set->addColor($color5);
208 $expected_color_set->addColor($color6);
209 $expected_color_set->addColor($color7);
211 $this->assertEquals($expected_color_set, $folder->getColorSet());
Abstracts a folder containing a set of icons.
◆ testFolderDoesNotExist()
ilSystemStyleIconFolderTest::testFolderDoesNotExist |
( |
| ) |
|
◆ testFolderGetIconByName()
ilSystemStyleIconFolderTest::testFolderGetIconByName |
( |
| ) |
|
Definition at line 105 of file ilSystemStyleIconFolderTest.php.
107 $style_path = $this->container->getImagesSkinPath($this->style->getId());
109 $path1 = $style_path .
"/test_image_1.svg";
112 $this->assertEquals($icon1, $folder->getIconByName(
"test_image_1.svg"));
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon. ...
Abstracts a folder containing a set of icons.
◆ testFolderGetIconByPath()
ilSystemStyleIconFolderTest::testFolderGetIconByPath |
( |
| ) |
|
Definition at line 115 of file ilSystemStyleIconFolderTest.php.
117 $style_path = $this->container->getImagesSkinPath($this->style->getId());
119 $path1 = $style_path .
"/test_image_1.svg";
122 $this->assertEquals($icon1, $folder->getIconByPath($path1));
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon. ...
Abstracts a folder containing a set of icons.
◆ testGetUsages()
ilSystemStyleIconFolderTest::testGetUsages |
( |
| ) |
|
Definition at line 241 of file ilSystemStyleIconFolderTest.php.
243 $style_path = $this->container->getImagesSkinPath($this->style->getId());
247 $path1 = $style_path .
"/test_image_1.svg";
249 $icon1->getColorSet();
251 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
253 $icon2->getColorSet();
255 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
257 $icon3->getColorSet();
259 $expected_icons_usages = [$icon2,$icon3,$icon1];
261 $this->assertEquals($expected_icons_usages, $folder1->getUsagesOfColor(
"id_6B6B6B"));
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon. ...
Abstracts a folder containing a set of icons.
◆ testGetUsagesAfterChangeColor()
ilSystemStyleIconFolderTest::testGetUsagesAfterChangeColor |
( |
| ) |
|
Definition at line 264 of file ilSystemStyleIconFolderTest.php.
266 $style_path = $this->container->getImagesSkinPath($this->style->getId());
269 $folder1->changeIconColors([
"6B6B6B" =>
"7B6B6B"]);
273 $path1 = $style_path .
"/test_image_1.svg";
275 $icon1->getColorSet();
277 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
279 $icon2->getColorSet();
281 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
283 $icon3->getColorSet();
285 $expected_icons_usages = [$icon2,$icon3,$icon1];
287 $this->assertEquals($expected_icons_usages, $folder2->getUsagesOfColor(
"id_7B6B6B"));
288 $this->assertEquals([], $folder2->getUsagesOfColor(
"id_6B6B6B"));
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon. ...
Abstracts a folder containing a set of icons.
◆ testGetUsagesAsString()
ilSystemStyleIconFolderTest::testGetUsagesAsString |
( |
| ) |
|
Definition at line 291 of file ilSystemStyleIconFolderTest.php.
296 'sub_test_image_1; sub_test_image_2; test_image_1; ',
297 $folder1->getUsagesOfColorAsString(
"id_6B6B6B")
Abstracts a folder containing a set of icons.
◆ testIconDoesNotExist()
ilSystemStyleIconFolderTest::testIconDoesNotExist |
( |
| ) |
|
◆ testReadRecursiveAndSortByFolder()
ilSystemStyleIconFolderTest::testReadRecursiveAndSortByFolder |
( |
| ) |
|
Definition at line 162 of file ilSystemStyleIconFolderTest.php.
164 $style_path = $this->container->getImagesSkinPath($this->style->getId());
166 $path1 = $style_path .
"/test_image_1.svg";
169 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
172 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
175 $path4 = $style_path .
"/nonsvg.png";
178 $path5 = $style_path .
"/icon_accs.svg";
182 $style_path => [$icon5,$icon1,$icon4],
183 $style_path .
"/image_subfolder" => [$icon2,$icon3],
187 $this->assertEquals($expected_icons, $folder->getIconsSortedByFolder());
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon. ...
Abstracts a folder containing a set of icons.
◆ testReadRecursiveAndSortByName()
ilSystemStyleIconFolderTest::testReadRecursiveAndSortByName |
( |
| ) |
|
Definition at line 137 of file ilSystemStyleIconFolderTest.php.
139 $style_path = $this->container->getImagesSkinPath($this->style->getId());
141 $path1 = $style_path .
"/test_image_1.svg";
144 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
147 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
150 $path4 = $style_path .
"/nonsvg.png";
153 $path5 = $style_path .
"/icon_accs.svg";
156 $expected_icons = [$icon5,$icon2,$icon3,$icon1,$icon4];
159 $this->assertEquals($expected_icons, $folder->getIcons());
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon. ...
Abstracts a folder containing a set of icons.
◆ testReadRecursiveCount()
ilSystemStyleIconFolderTest::testReadRecursiveCount |
( |
| ) |
|
◆ testSetPath()
ilSystemStyleIconFolderTest::testSetPath |
( |
| ) |
|
Definition at line 80 of file ilSystemStyleIconFolderTest.php.
83 $folder->setPath(
"pathnew");
85 $this->assertEquals(
"pathnew", $folder->getPath());
Abstracts a folder containing a set of icons.
◆ $container
ilSystemStyleIconFolderTest::$container |
|
protected |
◆ $icon_name
ilSystemStyleIconFolderTest::$icon_name = "test_image_1.svg" |
|
protected |
◆ $icon_type
ilSystemStyleIconFolderTest::$icon_type = "svg" |
|
protected |
◆ $save_dic
ilSystemStyleIconFolderTest::$save_dic = null |
|
protected |
◆ $style
ilSystemStyleIconFolderTest::$style |
|
protected |
◆ $system_style_config
ilSystemStyleIconFolderTest::$system_style_config |
|
protected |
The documentation for this class was generated from the following file: