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");
38 $this->skin =
new ilSkinXML(
"skin1",
"skin 1");
41 $this->style1->setCssFile(
"style1css");
42 $this->style1->setImageDirectory(
"style1image");
43 $this->style1->setSoundDirectory(
"style1sound");
44 $this->style1->setFontDirectory(
"style1font");
47 $this->style2->setCssFile(
"style2css");
48 $this->style2->setImageDirectory(
"style2image");
49 $this->style2->setSoundDirectory(
"style2sound");
50 $this->style2->setFontDirectory(
"style2font");
54 mkdir($this->system_style_config->test_skin_temp_path);
63 $this->assertEquals(
"skin1", $this->skin->getId());
64 $this->assertEquals(
"skin 1", $this->skin->getName());
69 $this->assertEquals(count($this->skin),0);
70 $this->assertEquals(count($this->skin->getStyles()),0);
71 $this->skin->addStyle($this->style1);
72 $this->assertEquals(count($this->skin),1);
73 $this->assertEquals(count($this->skin->getStyles()),1);
74 $this->skin->addStyle($this->style1);
75 $this->assertEquals(count($this->skin),2);
76 $this->assertEquals(count($this->skin->getStyles()),2);
77 $this->skin->addStyle($this->style2);
78 $this->assertEquals(count($this->skin),3);
79 $this->assertEquals(count($this->skin->getStyles()),3);
83 $this->skin->addStyle($this->style1);
84 $this->skin->addStyle($this->style2);
86 $this->assertNotEquals($this->skin->getStyle(
"style2"),
$this->style1);
87 $this->assertEquals($this->skin->getStyle(
"style2"),
$this->style2);
91 $this->skin->addStyle($this->style1);
92 $this->skin->addStyle($this->style2);
93 $this->assertEquals(count($this->skin),2);
94 $this->skin->removeStyle(
"style1");
95 $this->assertEquals(count($this->skin),1);
96 $this->skin->removeStyle(
"style2");
97 $this->assertEquals(count($this->skin),0);
101 $this->skin->addStyle($this->style1);
102 $this->skin->addStyle($this->style2);
103 $this->assertEquals(count($this->skin),2);
104 $this->skin->removeStyle(
"style1");
105 $this->assertEquals(count($this->skin),1);
106 $this->skin->removeStyle(
"style2");
107 $this->assertEquals(count($this->skin),0);
109 $this->skin->removeStyle(
"style2");
110 $this->assertTrue(
false);
118 $this->skin->addStyle($this->style1);
119 $this->skin->addStyle($this->style2);
120 $this->assertEquals($this->skin->asXML(),file_get_contents($this->system_style_config->getCustomizingSkinPath().
"skin1/template.xml"));
124 $this->skin->addStyle($this->style1);
125 $this->skin->addStyle($this->style2);
126 $this->skin->writeToXMLFile($this->system_style_config->getCustomizingSkinPath().
"skin1/template-copy.xml");
127 $this->assertEquals(file_get_contents($this->system_style_config->getCustomizingSkinPath().
"skin1/template-copy.xml")
128 ,file_get_contents($this->system_style_config->getCustomizingSkinPath().
"skin1/template.xml"));
129 unlink ($this->system_style_config->getCustomizingSkinPath().
"skin1/template-copy.xml");
133 $skin = ilSkinXML::parseFromXML($this->system_style_config->getCustomizingSkinPath().
"skin1/template.xml");
134 $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.