◆ setUp()
ilSystemStyleStyleLessFileTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 35 of file ilSystemStyleStyleLessFileTest.php.
References $DIC, ilSystemStyleSkinContainer\generateFromId(), and ilSystemStyleSkinContainer\xCopy().
39 $this->save_dic =
$DIC;
44 mkdir($this->system_style_config->test_skin_temp_path);
48 $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()
ilSystemStyleStyleLessFileTest::tearDown |
( |
| ) |
|
|
protected |
◆ testAddAndWriteItems()
ilSystemStyleStyleLessFileTest::testAddAndWriteItems |
( |
| ) |
|
Definition at line 202 of file ilSystemStyleStyleLessFileTest.php.
211 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
217 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
219 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
221 $expected_items = [$expected_category1,
222 $expected_comment2,$expected_comment3,
223 $expected_variable11,$expected_variable12,$expected_variable13,
226 $expected_comment6,$expected_comment7,$expected_comment8,
227 $expected_variable21,$expected_variable22,$expected_variable23];
229 foreach ($expected_items as $item) {
230 $empty_less->addItem($item);
232 $empty_less->write();
235 $this->assertEquals($expected_items, $new_less->getItems());
Capsules data of a less category in the variables to less file.
◆ testChangeVariable()
ilSystemStyleStyleLessFileTest::testChangeVariable |
( |
| ) |
|
Definition at line 170 of file ilSystemStyleStyleLessFileTest.php.
References $file.
173 $variable =
$file->getVariableByName(
"variable11");
174 $variable->setValue(
"newvalue11");
179 $expected_variable11 =
new ilSystemStyleLessVariable(
"variable11",
"newvalue11",
"comment variable 11",
"Category 1", []);
181 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
187 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
189 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
191 $expected_items = [$expected_category1,
192 $expected_comment2,$expected_comment3,
193 $expected_variable11,$expected_variable12,$expected_variable13,
196 $expected_comment6,$expected_comment7,$expected_comment8,
197 $expected_variable21,$expected_variable22,$expected_variable23];
199 $this->assertEquals($expected_items,
$file->getItems());
Capsules data of a less category in the variables to less file.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testConstructAndRead()
ilSystemStyleStyleLessFileTest::testConstructAndRead |
( |
| ) |
|
◆ testGetCategory()
ilSystemStyleStyleLessFileTest::testGetCategory |
( |
| ) |
|
Definition at line 96 of file ilSystemStyleStyleLessFileTest.php.
References $file.
102 $expected_categories = [$expected_category1,$expected_category2];
104 $this->assertEquals($expected_categories,
$file->getCategories());
Capsules data of a less category in the variables to less file.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetContent()
ilSystemStyleStyleLessFileTest::testGetContent |
( |
| ) |
|
Definition at line 137 of file ilSystemStyleStyleLessFileTest.php.
References $file.
140 $expected_content = file_get_contents($this->container->getLessVariablesFilePath($this->style->getId()));
141 $this->assertEquals($expected_content,
$file->getContent());
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetItems()
ilSystemStyleStyleLessFileTest::testGetItems |
( |
| ) |
|
Definition at line 107 of file ilSystemStyleStyleLessFileTest.php.
References $file.
116 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
122 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
124 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
126 $expected_items = [$expected_category1,
127 $expected_comment2,$expected_comment3,
128 $expected_variable11,$expected_variable12,$expected_variable13,
131 $expected_comment6,$expected_comment7,$expected_comment8,
132 $expected_variable21,$expected_variable22,$expected_variable23];
134 $this->assertEquals($expected_items,
$file->getItems());
Capsules data of a less category in the variables to less file.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetItemsEdgeCases()
ilSystemStyleStyleLessFileTest::testGetItemsEdgeCases |
( |
| ) |
|
Definition at line 273 of file ilSystemStyleStyleLessFileTest.php.
References $file.
285 $expected_variable21 =
new ilSystemStyleLessVariable(
"variableNoValidSection1",
"value21",
"",
"Category 1 no valid section", []);
286 $expected_variable22 =
new ilSystemStyleLessVariable(
"variableNoValidSection2",
"value22",
"comment",
"Category 1 no valid section", []);
293 $expected_variable32 =
new ilSystemStyleLessVariable(
"variable21",
"floor((@regular * 1.6)) * lighten(@regular, 20%)",
"Hard references",
"Category 2", [
"regular"]);
300 $expected_items = [$expected_comment1,$expected_comment2,
301 $expected_variable11,$expected_variable12,
302 $expected_category1,$expected_variable21,$expected_variable22,
304 $expected_category2,$expected_variable31,$expected_variable32,
306 $expected_category3,$expected_variable41];
308 $this->assertEquals($expected_items,
$file->getItems());
Capsules data of a less category in the variables to less file.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetVariableByName()
ilSystemStyleStyleLessFileTest::testGetVariableByName |
( |
| ) |
|
Definition at line 75 of file ilSystemStyleStyleLessFileTest.php.
References $file.
81 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
83 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
85 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
87 $this->assertEquals($expected_variable11,
$file->getVariableByName(
"variable11"));
88 $this->assertEquals($expected_variable12,
$file->getVariableByName(
"variable12"));
89 $this->assertEquals($expected_variable13,
$file->getVariableByName(
"variable13"));
91 $this->assertEquals($expected_variable21,
$file->getVariableByName(
"variable21"));
92 $this->assertEquals($expected_variable22,
$file->getVariableByName(
"variable22"));
93 $this->assertEquals($expected_variable23,
$file->getVariableByName(
"variable23"));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetVariableReferences()
ilSystemStyleStyleLessFileTest::testGetVariableReferences |
( |
| ) |
|
Definition at line 238 of file ilSystemStyleStyleLessFileTest.php.
References $file.
242 $this->assertEquals([
"variable13",
"variable21"],
$file->getReferencesToVariable(
"variable11"));
243 $this->assertEquals([],
$file->getReferencesToVariable(
"variable12"));
244 $this->assertEquals([],
$file->getReferencesToVariable(
"variable13"));
246 $this->assertEquals([
"variable23"],
$file->getReferencesToVariable(
"variable21"));
247 $this->assertEquals([],
$file->getReferencesToVariable(
"variable22"));
248 $this->assertEquals([],
$file->getReferencesToVariable(
"variable23"));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetVariableReferencesAsString()
ilSystemStyleStyleLessFileTest::testGetVariableReferencesAsString |
( |
| ) |
|
Definition at line 251 of file ilSystemStyleStyleLessFileTest.php.
References $file.
255 $this->assertEquals(
"variable13; variable21; ",
$file->getReferencesToVariableAsString(
"variable11"));
256 $this->assertEquals(
"",
$file->getReferencesToVariableAsString(
"variable12"));
257 $this->assertEquals(
"",
$file->getReferencesToVariableAsString(
"variable13"));
259 $this->assertEquals(
"variable23; ",
$file->getReferencesToVariableAsString(
"variable21"));
260 $this->assertEquals(
"",
$file->getReferencesToVariableAsString(
"variable22"));
261 $this->assertEquals(
"",
$file->getReferencesToVariableAsString(
"variable23"));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testReadCorrectTypes()
ilSystemStyleStyleLessFileTest::testReadCorrectTypes |
( |
| ) |
|
Definition at line 65 of file ilSystemStyleStyleLessFileTest.php.
References $file.
69 $this->assertEquals(2, count(
$file->getCategories()));
70 $this->assertEquals(6, count(
$file->getVariablesIds()));
71 $this->assertEquals(6, count(
$file->getCommentsIds()));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testReadCorrectTypesEdgeCases()
ilSystemStyleStyleLessFileTest::testReadCorrectTypesEdgeCases |
( |
| ) |
|
Definition at line 264 of file ilSystemStyleStyleLessFileTest.php.
References $file.
268 $this->assertEquals(3, count(
$file->getCategories()));
269 $this->assertEquals(7, count(
$file->getVariablesIds()));
270 $this->assertEquals(4, count(
$file->getCommentsIds()));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testReadWriteDouble()
ilSystemStyleStyleLessFileTest::testReadWriteDouble |
( |
| ) |
|
Definition at line 144 of file ilSystemStyleStyleLessFileTest.php.
References $file.
146 $expected_content = file_get_contents($this->container->getLessVariablesFilePath($this->style->getId()));
154 $this->assertEquals($expected_content,
$file->getContent());
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testReadWriteDoubleFullLess()
ilSystemStyleStyleLessFileTest::testReadWriteDoubleFullLess |
( |
| ) |
|
Definition at line 157 of file ilSystemStyleStyleLessFileTest.php.
References $file, and ilSystemStyleLessFile\write().
159 $expected_content = file_get_contents($this->container->getSkinDirectory() .
"full.less");
167 $this->assertEquals($expected_content, $file->getContent());
write()
Write the complete file back to the file system (including comments and random content) ...
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ $container
ilSystemStyleStyleLessFileTest::$container |
|
protected |
◆ $save_dic
ilSystemStyleStyleLessFileTest::$save_dic = null |
|
protected |
◆ $style
ilSystemStyleStyleLessFileTest::$style |
|
protected |
◆ $system_style_config
ilSystemStyleStyleLessFileTest::$system_style_config |
|
protected |
The documentation for this class was generated from the following file: