4 include_once(
"./Services/Style/System/classes/Utilities/class.ilSkinStyleXML.php");
5 include_once(
"./Services/Style/System/classes/Utilities/class.ilSkinXML.php");
6 include_once(
"./Services/Style/System/test/fixtures/mocks/ilSystemStyleConfigMock.php");
7 include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleSkinContainer.php");
44 $this->save_dic =
$DIC;
46 $this->skin =
new ilSkinXML(
"skin1",
"skin 1");
49 $this->style1->setCssFile(
"style1css");
50 $this->style1->setImageDirectory(
"style1image");
51 $this->style1->setSoundDirectory(
"style1sound");
52 $this->style1->setFontDirectory(
"style1font");
55 $this->style2->setCssFile(
"style2css");
56 $this->style2->setImageDirectory(
"style2image");
57 $this->style2->setSoundDirectory(
"style2sound");
58 $this->style2->setFontDirectory(
"style2font");
62 mkdir($this->system_style_config->test_skin_temp_path);
76 $this->assertEquals(
"skin1", $this->skin->getId());
77 $this->assertEquals(
"skin 1", $this->skin->getName());
82 $this->assertEquals(count($this->skin), 0);
83 $this->assertEquals(count($this->skin->getStyles()), 0);
84 $this->skin->addStyle($this->style1);
85 $this->assertEquals(count($this->skin), 1);
86 $this->assertEquals(count($this->skin->getStyles()), 1);
87 $this->skin->addStyle($this->style1);
88 $this->assertEquals(count($this->skin), 2);
89 $this->assertEquals(count($this->skin->getStyles()), 2);
90 $this->skin->addStyle($this->style2);
91 $this->assertEquals(count($this->skin), 3);
92 $this->assertEquals(count($this->skin->getStyles()), 3);
97 $this->skin->addStyle($this->style1);
98 $this->skin->addStyle($this->style2);
100 $this->assertNotEquals($this->skin->getStyle(
"style2"),
$this->style1);
101 $this->assertEquals($this->skin->getStyle(
"style2"),
$this->style2);
106 $this->skin->addStyle($this->style1);
107 $this->skin->addStyle($this->style2);
108 $this->assertEquals(count($this->skin), 2);
109 $this->skin->removeStyle(
"style1");
110 $this->assertEquals(count($this->skin), 1);
111 $this->skin->removeStyle(
"style2");
112 $this->assertEquals(count($this->skin), 0);
117 $this->skin->addStyle($this->style1);
118 $this->skin->addStyle($this->style2);
119 $this->assertEquals(count($this->skin), 2);
120 $this->skin->removeStyle(
"style1");
121 $this->assertEquals(count($this->skin), 1);
122 $this->skin->removeStyle(
"style2");
123 $this->assertEquals(count($this->skin), 0);
125 $this->skin->removeStyle(
"style2");
126 $this->assertTrue(
false);
134 $this->skin->addStyle($this->style1);
135 $this->skin->addStyle($this->style2);
136 $this->assertEquals($this->skin->asXML(), file_get_contents($this->system_style_config->getCustomizingSkinPath() .
"skin1/template.xml"));
141 $this->skin->addStyle($this->style1);
142 $this->skin->addStyle($this->style2);
143 $this->skin->writeToXMLFile($this->system_style_config->getCustomizingSkinPath() .
"skin1/template-copy.xml");
144 $this->assertEquals(file_get_contents($this->system_style_config->getCustomizingSkinPath() .
"skin1/template-copy.xml"), file_get_contents($this->system_style_config->getCustomizingSkinPath() .
"skin1/template.xml"));
145 unlink($this->system_style_config->getCustomizingSkinPath() .
"skin1/template-copy.xml");
150 $skin = ilSkinXML::parseFromXML($this->system_style_config->getCustomizingSkinPath() .
"skin1/template.xml");
151 $this->assertEquals(
$skin->asXML(), file_get_contents($this->system_style_config->getCustomizingSkinPath() .
"skin1/template.xml"));
ilSkinXml holds an manages the basic data of a skin as provide by the template of the skin...
static recursiveRemoveDir($dir)
Recursive delete of a folder.
Class for advanced editing exception handling in ILIAS.
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
static xCopy($src, $dest)
Recursive copy of a folder.