◆ 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 196 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 174 of file ilSystemStyleIconFolderTest.php.
186 $expected_color_set->addColor($color1);
187 $expected_color_set->addColor($color2);
188 $expected_color_set->addColor($color3);
189 $expected_color_set->addColor($color4);
190 $expected_color_set->addColor($color5);
191 $expected_color_set->addColor($color6);
193 $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.
221 $style_path = $this->container->getImagesSkinPath($this->
style->getId());
225 $path1 = $style_path .
"/test_image_1.svg";
227 $icon1->getColorSet();
229 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
231 $icon2->getColorSet();
233 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
235 $icon3->getColorSet();
237 $expected_icons_usages = [$icon2,$icon3,$icon1];
239 $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 242 of file ilSystemStyleIconFolderTest.php.
243 $style_path = $this->container->getImagesSkinPath($this->
style->getId());
246 $folder1->changeIconColors([
"6B6B6B"=>
"7B6B6B"]);
250 $path1 = $style_path .
"/test_image_1.svg";
252 $icon1->getColorSet();
254 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
256 $icon2->getColorSet();
258 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
260 $icon3->getColorSet();
262 $expected_icons_usages = [$icon2,$icon3,$icon1];
264 $this->assertEquals($expected_icons_usages,$folder2->getUsagesOfColor(
"7B6B6B"));
265 $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 268 of file ilSystemStyleIconFolderTest.php.
271 $this->assertEquals(
'sub_test_image_1; sub_test_image_2; test_image_1; ' ,
272 $folder1->getUsagesOfColorAsString(
"6B6B6B"));
Abstracts a folder containing a set of icons.
◆ testIconDoesNotExist()
ilSystemStyleIconFolderTest::testIconDoesNotExist |
( |
| ) |
|
◆ testReadRecursiveAndSortByFolder()
ilSystemStyleIconFolderTest::testReadRecursiveAndSortByFolder |
( |
| ) |
|
Definition at line 149 of file ilSystemStyleIconFolderTest.php.
151 $style_path = $this->container->getImagesSkinPath($this->
style->getId());
153 $path1 = $style_path.
"/test_image_1.svg";
156 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
159 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
162 $path4 = $style_path .
"/nonsvg.png";
166 $style_path => [$icon1,$icon4],
167 $style_path.
"/image_subfolder" => [$icon2,$icon3],
171 $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 127 of file ilSystemStyleIconFolderTest.php.
129 $style_path = $this->container->getImagesSkinPath($this->
style->getId());
131 $path1 = $style_path .
"/test_image_1.svg";
134 $path2 = $style_path .
"/image_subfolder/sub_test_image_1.svg";
137 $path3 = $style_path .
"/image_subfolder/sub_test_image_2.svg";
140 $path4 = $style_path .
"/nonsvg.png";
143 $expected_icons = [$icon2,$icon3,$icon1,$icon4];
146 $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: