19declare(strict_types=1);
21require_once(
'libs/composer/vendor/autoload.php');
30 protected function setUp(): void
34 if (!defined(
'PATH_TO_LESSC')) {
35 if (file_exists(
'ilias.ini.php')) {
36 $ini = parse_ini_file(
'ilias.ini.php',
true);
37 define(
'PATH_TO_LESSC',
$ini[
'tools'][
'lessc'] ??
'');
39 define(
'PATH_TO_LESSC',
'');
43 $this->skin =
new ilSkin(
'skin1',
'skin 1');
45 $this->style1 =
new ilSkinStyle(
'style1',
'Style 1');
46 $this->style1->setCssFile(
'style1css');
47 $this->style1->setImageDirectory(
'style1image');
48 $this->style1->setSoundDirectory(
'style1sound');
49 $this->style1->setFontDirectory(
'style1font');
51 $this->style2 =
new ilSkinStyle(
'style2',
'Style 2');
52 $this->style2->setCssFile(
'style2css');
53 $this->style2->setImageDirectory(
'style2image');
54 $this->style2->setSoundDirectory(
'style2sound');
55 $this->style2->setFontDirectory(
'style2font');
62 $container = $this->factory->skinStyleContainerFromId($this->skin->getId(), $this->message_stack);
67 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() .
'newSkin'));
69 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() .
'newSkin'));
74 $container = $this->factory->skinStyleContainerFromId($this->skin->getId(), $this->message_stack);
76 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId()));
81 $container = $this->factory->skinStyleContainerFromId($this->skin->getId(), $this->message_stack);
85 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() .
'newSkin2'));
89 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() .
'newSkin2'));
94 $new_style =
new ilSkinStyle(
'style1new',
'new Style');
95 $new_style->setCssFile(
'style1new');
96 $new_style->setImageDirectory(
'style1newimage');
97 $new_style->setSoundDirectory(
'style1newsound');
98 $new_style->setFontDirectory(
'style1newfont');
100 $container = $this->factory->skinStyleContainerFromId($this->skin->getId(), $this->message_stack);
102 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1image'));
103 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1sound'));
104 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1font'));
105 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css.css'));
106 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css.less'));
107 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css-variables.less'));
109 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1newimage'));
110 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1newsound'));
111 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1newfont'));
112 $this->assertFalse(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1new.css'));
113 $this->assertFalse(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1new.less'));
114 $this->assertFalse(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1new-variables.less'));
118 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1image'));
119 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1sound'));
120 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1font'));
121 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css.css'));
122 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css.less'));
123 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css-variables.less'));
125 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1newimage'));
126 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1newsound'));
127 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1newfont'));
128 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1new.css'));
129 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1new.less'));
130 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1new-variables.less'));
135 $container = $this->factory->skinStyleContainerFromId($this->skin->getId(), $this->message_stack);
139 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1image'));
140 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1sound'));
141 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1font'));
142 $this->assertFalse(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css.css'));
143 $this->assertFalse(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css.less'));
144 $this->assertFalse(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css-variables.less'));
146 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style2image'));
147 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style2sound'));
148 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style2font'));
149 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style2css.css'));
150 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style2css.less'));
151 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style2css-variables.less'));
156 $container = $this->factory->skinStyleContainerFromId($this->skin->getId(), $this->message_stack);
162 $new_style->setId(
'style1new');
163 $new_style->setName(
'new Style');
164 $new_style->setCssFile(
'style1new');
165 $new_style->setImageDirectory(
'style1newimage');
166 $new_style->setSoundDirectory(
'style1newsound');
167 $new_style->setFontDirectory(
'style1newfont');
171 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1image'));
172 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1sound'));
173 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1font'));
174 $this->assertFalse(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css.css'));
175 $this->assertFalse(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css.less'));
176 $this->assertFalse(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1css-variables.less'));
178 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1newimage'));
179 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1newsound'));
180 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1newfont'));
181 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1new.css'));
182 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1new.less'));
183 $this->assertTrue(is_file($this->system_style_config->getCustomizingSkinPath() . $this->skin->getId() .
'/style1new-variables.less'));
188 $container = $this->factory->skinStyleContainerFromId($this->skin->getId(), $this->message_stack);
191 $this->assertTrue(is_dir($this->system_style_config->getCustomizingSkinPath() .
$skin->
getId()));
193 $this->assertFalse(is_dir($this->system_style_config->getCustomizingSkinPath() .
$skin->
getId()));
Factory to create Skin classes holds an manages the basic data of a skin as provide by the template o...
testUpdateSkinNoIdChange()
testUpdateSkinWithChangedID()
updateSkin(ilSkin $old_skin=null)
Updates the skin.
delete()
Deletes the container of a skin completely.
deleteStyle(ilSkinStyle $style)
Deletes a style completely.
addStyle(ilSkinStyle $style)
create(ilSystemStyleMessageStack $message_stack)
Creates a new skin.
updateStyle(string $style_id, ilSkinStyle $old_style)
Updates one single style.
ilSkin holds an manages the basic data of a skin as provide by the template of the skin.
ilSkinStyleContainer $container