◆ setUp()
ilSystemStyleIconFolderTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 48 of file ilSystemStyleIconFolderTest.php.
References $DIC, ilSystemStyleSkinContainer\generateFromId(), and ilSystemStyleSkinContainer\xCopy().
52 $this->save_dic =
$DIC;
57 mkdir($this->system_style_config->test_skin_temp_path);
61 $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 72 of file ilSystemStyleIconFolderTest.php.
76 $this->assertEquals($this->container->getImagesSkinPath($this->style->getId()), $folder->getPath());
Abstracts a folder containing a set of icons.
◆ testExtractChangeColors()
ilSystemStyleIconFolderTest::testExtractChangeColors |
( |
| ) |
|
Definition at line 195 of file ilSystemStyleIconFolderTest.php.
198 $folder1->changeIconColors([
"505050"=>
"555555"]);
210 $expected_color_set->addColor($color2);
211 $expected_color_set->addColor($color3);
212 $expected_color_set->addColor($color4);
213 $expected_color_set->addColor($color5);
214 $expected_color_set->addColor($color6);
215 $expected_color_set->addColor($color1);
217 $this->assertEquals($expected_color_set, $folder2->getColorSet());
Abstracts a folder containing a set of icons.
◆ testExtractColorset()
ilSystemStyleIconFolderTest::testExtractColorset |
( |
| ) |
|
Definition at line 173 of file ilSystemStyleIconFolderTest.php.
185 $expected_color_set->addColor($color1);
186 $expected_color_set->addColor($color2);
187 $expected_color_set->addColor($color3);
188 $expected_color_set->addColor($color4);
189 $expected_color_set->addColor($color5);
190 $expected_color_set->addColor($color6);
192 $this->assertEquals($expected_color_set, $folder->getColorSet());
Abstracts a folder containing a set of icons.
◆ testFolderDoesNotExist()
ilSystemStyleIconFolderTest::testFolderDoesNotExist |
( |
| ) |
|
◆ testFolderGetIcon()
ilSystemStyleIconFolderTest::testFolderGetIcon |
( |
| ) |
|
Definition at line 104 of file ilSystemStyleIconFolderTest.php.
106 $style_path = $this->container->getImagesSkinPath($this->
style->getId());
108 $path1 = $style_path .
"/test_image_1.svg";
111 $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.
◆ testGetUsages()
ilSystemStyleIconFolderTest::testGetUsages |
( |
| ) |
|
Definition at line 220 of file ilSystemStyleIconFolderTest.php.
222 $style_path = $this->container->getImagesSkinPath($this->
style->getId());
226 $path1 = $style_path .
"/test_image_1.svg";
228 $icon1->getColorSet();
230 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
232 $icon2->getColorSet();
234 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
236 $icon3->getColorSet();
238 $expected_icons_usages = [$icon2,$icon3,$icon1];
240 $this->assertEquals($expected_icons_usages, $folder1->getUsagesOfColor(
"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 243 of file ilSystemStyleIconFolderTest.php.
245 $style_path = $this->container->getImagesSkinPath($this->
style->getId());
248 $folder1->changeIconColors([
"6B6B6B"=>
"7B6B6B"]);
252 $path1 = $style_path .
"/test_image_1.svg";
254 $icon1->getColorSet();
256 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
258 $icon2->getColorSet();
260 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
262 $icon3->getColorSet();
264 $expected_icons_usages = [$icon2,$icon3,$icon1];
266 $this->assertEquals($expected_icons_usages, $folder2->getUsagesOfColor(
"7B6B6B"));
267 $this->assertEquals([], $folder2->getUsagesOfColor(
"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 270 of file ilSystemStyleIconFolderTest.php.
275 'sub_test_image_1; sub_test_image_2; test_image_1; ',
276 $folder1->getUsagesOfColorAsString(
"6B6B6B")
Abstracts a folder containing a set of icons.
◆ testIconDoesNotExist()
ilSystemStyleIconFolderTest::testIconDoesNotExist |
( |
| ) |
|
◆ testReadRecursiveAndSortByFolder()
ilSystemStyleIconFolderTest::testReadRecursiveAndSortByFolder |
( |
| ) |
|
Definition at line 148 of file ilSystemStyleIconFolderTest.php.
150 $style_path = $this->container->getImagesSkinPath($this->
style->getId());
152 $path1 = $style_path .
"/test_image_1.svg";
155 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
158 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
161 $path4 = $style_path .
"/nonsvg.png";
165 $style_path => [$icon1,$icon4],
166 $style_path .
"/image_subfolder" => [$icon2,$icon3],
170 $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 126 of file ilSystemStyleIconFolderTest.php.
128 $style_path = $this->container->getImagesSkinPath($this->
style->getId());
130 $path1 = $style_path .
"/test_image_1.svg";
133 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
136 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
139 $path4 = $style_path .
"/nonsvg.png";
142 $expected_icons = [$icon2,$icon3,$icon1,$icon4];
145 $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 79 of file ilSystemStyleIconFolderTest.php.
82 $folder->setPath(
"pathnew");
84 $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: