◆ setUp()
ilSkinStyleLessFileTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 32 of file ilSkinStyleLessFileTest.php.
References $DIC, ilSystemStyleSkinContainer\generateFromId(), and ilSystemStyleSkinContainer\xCopy().
40 mkdir($this->system_style_config->test_skin_temp_path);
44 $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()
ilSkinStyleLessFileTest::tearDown |
( |
| ) |
|
|
protected |
◆ testAddAndWriteItems()
ilSkinStyleLessFileTest::testAddAndWriteItems |
( |
| ) |
|
Definition at line 195 of file ilSkinStyleLessFileTest.php.
204 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
210 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
212 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
214 $expected_items = [$expected_category1,
215 $expected_comment2,$expected_comment3,
216 $expected_variable11,$expected_variable12,$expected_variable13,
219 $expected_comment6,$expected_comment7,$expected_comment8,
220 $expected_variable21,$expected_variable22,$expected_variable23];
222 foreach ($expected_items as $item) {
223 $empty_less->addItem($item);
225 $empty_less->write();
228 $this->assertEquals($expected_items, $new_less->getItems());
Capsules data of a less category in the variables to less file.
◆ testChangeVariable()
ilSkinStyleLessFileTest::testChangeVariable |
( |
| ) |
|
Definition at line 163 of file ilSkinStyleLessFileTest.php.
165 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
166 $variable = $file->getVariableByName(
"variable11");
167 $variable->setValue(
"newvalue11");
172 $expected_variable11 =
new ilSystemStyleLessVariable(
"variable11",
"newvalue11",
"comment variable 11",
"Category 1", []);
174 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
180 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
182 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
184 $expected_items = [$expected_category1,
185 $expected_comment2,$expected_comment3,
186 $expected_variable11,$expected_variable12,$expected_variable13,
189 $expected_comment6,$expected_comment7,$expected_comment8,
190 $expected_variable21,$expected_variable22,$expected_variable23];
192 $this->assertEquals($expected_items, $file->getItems());
Capsules data of a less category in the variables to less file.
◆ testConstructAndRead()
ilSkinStyleLessFileTest::testConstructAndRead |
( |
| ) |
|
◆ testGetCategory()
ilSkinStyleLessFileTest::testGetCategory |
( |
| ) |
|
Definition at line 89 of file ilSkinStyleLessFileTest.php.
95 $expected_categories = [$expected_category1,$expected_category2];
97 $this->assertEquals($expected_categories, $file->getCategories());
Capsules data of a less category in the variables to less file.
◆ testGetContent()
ilSkinStyleLessFileTest::testGetContent |
( |
| ) |
|
Definition at line 130 of file ilSkinStyleLessFileTest.php.
132 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
133 $expected_content = file_get_contents($this->container->getLessVariablesFilePath($this->style->getId()));
134 $this->assertEquals($expected_content, $file->getContent());
◆ testGetItems()
ilSkinStyleLessFileTest::testGetItems |
( |
| ) |
|
Definition at line 100 of file ilSkinStyleLessFileTest.php.
102 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
109 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
115 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
117 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
119 $expected_items = [$expected_category1,
120 $expected_comment2,$expected_comment3,
121 $expected_variable11,$expected_variable12,$expected_variable13,
124 $expected_comment6,$expected_comment7,$expected_comment8,
125 $expected_variable21,$expected_variable22,$expected_variable23];
127 $this->assertEquals($expected_items, $file->getItems());
Capsules data of a less category in the variables to less file.
◆ testGetItemsEdgeCases()
ilSkinStyleLessFileTest::testGetItemsEdgeCases |
( |
| ) |
|
Definition at line 266 of file ilSkinStyleLessFileTest.php.
278 $expected_variable21 =
new ilSystemStyleLessVariable(
"variableNoValidSection1",
"value21",
"",
"Category 1 no valid section", []);
279 $expected_variable22 =
new ilSystemStyleLessVariable(
"variableNoValidSection2",
"value22",
"comment",
"Category 1 no valid section", []);
286 $expected_variable32 =
new ilSystemStyleLessVariable(
"variable21",
"floor((@regular * 1.6)) * lighten(@regular, 20%)",
"Hard references",
"Category 2", [
"regular"]);
293 $expected_items = [$expected_comment1,$expected_comment2,
294 $expected_variable11,$expected_variable12,
295 $expected_category1,$expected_variable21,$expected_variable22,
297 $expected_category2,$expected_variable31,$expected_variable32,
299 $expected_category3,$expected_variable41];
301 $this->assertEquals($expected_items, $file->getItems());
Capsules data of a less category in the variables to less file.
◆ testGetVariableByName()
ilSkinStyleLessFileTest::testGetVariableByName |
( |
| ) |
|
Definition at line 68 of file ilSkinStyleLessFileTest.php.
74 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
76 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
78 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
80 $this->assertEquals($expected_variable11, $file->getVariableByName(
"variable11"));
81 $this->assertEquals($expected_variable12, $file->getVariableByName(
"variable12"));
82 $this->assertEquals($expected_variable13, $file->getVariableByName(
"variable13"));
84 $this->assertEquals($expected_variable21, $file->getVariableByName(
"variable21"));
85 $this->assertEquals($expected_variable22, $file->getVariableByName(
"variable22"));
86 $this->assertEquals($expected_variable23, $file->getVariableByName(
"variable23"));
◆ testGetVariableReferences()
ilSkinStyleLessFileTest::testGetVariableReferences |
( |
| ) |
|
Definition at line 231 of file ilSkinStyleLessFileTest.php.
233 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
235 $this->assertEquals([
"variable13",
"variable21"], $file->getReferencesToVariable(
"variable11"));
236 $this->assertEquals([], $file->getReferencesToVariable(
"variable12"));
237 $this->assertEquals([], $file->getReferencesToVariable(
"variable13"));
239 $this->assertEquals([
"variable23"], $file->getReferencesToVariable(
"variable21"));
240 $this->assertEquals([], $file->getReferencesToVariable(
"variable22"));
241 $this->assertEquals([], $file->getReferencesToVariable(
"variable23"));
◆ testGetVariableReferencesAsString()
ilSkinStyleLessFileTest::testGetVariableReferencesAsString |
( |
| ) |
|
Definition at line 244 of file ilSkinStyleLessFileTest.php.
246 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
248 $this->assertEquals(
"variable13; variable21; ", $file->getReferencesToVariableAsString(
"variable11"));
249 $this->assertEquals(
"", $file->getReferencesToVariableAsString(
"variable12"));
250 $this->assertEquals(
"", $file->getReferencesToVariableAsString(
"variable13"));
252 $this->assertEquals(
"variable23; ", $file->getReferencesToVariableAsString(
"variable21"));
253 $this->assertEquals(
"", $file->getReferencesToVariableAsString(
"variable22"));
254 $this->assertEquals(
"", $file->getReferencesToVariableAsString(
"variable23"));
◆ testReadCorrectTypes()
ilSkinStyleLessFileTest::testReadCorrectTypes |
( |
| ) |
|
Definition at line 58 of file ilSkinStyleLessFileTest.php.
62 $this->assertEquals(2, count($file->getCategories()));
63 $this->assertEquals(6, count($file->getVariablesIds()));
64 $this->assertEquals(6, count($file->getCommentsIds()));
◆ testReadCorrectTypesEdgeCases()
ilSkinStyleLessFileTest::testReadCorrectTypesEdgeCases |
( |
| ) |
|
Definition at line 257 of file ilSkinStyleLessFileTest.php.
261 $this->assertEquals(3, count($file->getCategories()));
262 $this->assertEquals(7, count($file->getVariablesIds()));
263 $this->assertEquals(4, count($file->getCommentsIds()));
◆ testReadWriteDouble()
ilSkinStyleLessFileTest::testReadWriteDouble |
( |
| ) |
|
Definition at line 137 of file ilSkinStyleLessFileTest.php.
139 $expected_content = file_get_contents($this->container->getLessVariablesFilePath($this->style->getId()));
141 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
143 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
145 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
147 $this->assertEquals($expected_content, $file->getContent());
◆ testReadWriteDoubleFullLess()
ilSkinStyleLessFileTest::testReadWriteDoubleFullLess |
( |
| ) |
|
Definition at line 150 of file ilSkinStyleLessFileTest.php.
References ilSystemStyleLessFile\write().
152 $expected_content = file_get_contents($this->container->getSkinDirectory() .
"full.less");
160 $this->assertEquals($expected_content, $file->getContent());
write()
Write the complete file back to the file system (including comments and random content) ...
◆ $container
ilSkinStyleLessFileTest::$container |
|
protected |
◆ $style
ilSkinStyleLessFileTest::$style |
|
protected |
◆ $system_style_config
ilSkinStyleLessFileTest::$system_style_config |
|
protected |
The documentation for this class was generated from the following file: