◆ 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 187 of file ilSkinStyleLessFileTest.php.
195 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
201 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
203 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
205 $expected_items = [$expected_category1,
206 $expected_comment2,$expected_comment3,
207 $expected_variable11,$expected_variable12,$expected_variable13,
210 $expected_comment6,$expected_comment7,$expected_comment8,
211 $expected_variable21,$expected_variable22,$expected_variable23];
213 foreach($expected_items as $item){
214 $empty_less->addItem($item);
216 $empty_less->write();
219 $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 155 of file ilSkinStyleLessFileTest.php.
References $file.
157 $variable =
$file->getVariableByName(
"variable11");
158 $variable->setValue(
"newvalue11");
163 $expected_variable11 =
new ilSystemStyleLessVariable(
"variable11",
"newvalue11",
"comment variable 11",
"Category 1", []);
165 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
171 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
173 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
175 $expected_items = [$expected_category1,
176 $expected_comment2,$expected_comment3,
177 $expected_variable11,$expected_variable12,$expected_variable13,
180 $expected_comment6,$expected_comment7,$expected_comment8,
181 $expected_variable21,$expected_variable22,$expected_variable23];
183 $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()
ilSkinStyleLessFileTest::testConstructAndRead |
( |
| ) |
|
Definition at line 52 of file ilSkinStyleLessFileTest.php.
References $file.
54 $this->assertEquals(14,count(
$file->getItems()));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetCategory()
ilSkinStyleLessFileTest::testGetCategory |
( |
| ) |
|
Definition at line 86 of file ilSkinStyleLessFileTest.php.
References $file.
91 $expected_categories = [$expected_category1,$expected_category2];
93 $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()
ilSkinStyleLessFileTest::testGetContent |
( |
| ) |
|
Definition at line 125 of file ilSkinStyleLessFileTest.php.
References $file.
127 $expected_content = file_get_contents($this->container->getLessVariablesFilePath($this->style->getId()));
128 $this->assertEquals($expected_content,
$file->getContent());
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetItems()
ilSkinStyleLessFileTest::testGetItems |
( |
| ) |
|
Definition at line 96 of file ilSkinStyleLessFileTest.php.
References $file.
104 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
110 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
112 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
114 $expected_items = [$expected_category1,
115 $expected_comment2,$expected_comment3,
116 $expected_variable11,$expected_variable12,$expected_variable13,
119 $expected_comment6,$expected_comment7,$expected_comment8,
120 $expected_variable21,$expected_variable22,$expected_variable23];
122 $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()
ilSkinStyleLessFileTest::testGetItemsEdgeCases |
( |
| ) |
|
Definition at line 254 of file ilSkinStyleLessFileTest.php.
References $file.
265 $expected_variable21 =
new ilSystemStyleLessVariable(
"variableNoValidSection1",
"value21",
"",
"Category 1 no valid section", []);
266 $expected_variable22 =
new ilSystemStyleLessVariable(
"variableNoValidSection2",
"value22",
"comment",
"Category 1 no valid section", []);
273 $expected_variable32 =
new ilSystemStyleLessVariable(
"variable21",
"floor((@regular * 1.6)) * lighten(@regular, 20%)",
"Hard references",
"Category 2", [
"regular"]);
280 $expected_items = [$expected_comment1,$expected_comment2,
281 $expected_variable11,$expected_variable12,
282 $expected_category1,$expected_variable21,$expected_variable22,
284 $expected_category2,$expected_variable31,$expected_variable32,
286 $expected_category3,$expected_variable41];
288 $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()
ilSkinStyleLessFileTest::testGetVariableByName |
( |
| ) |
|
Definition at line 66 of file ilSkinStyleLessFileTest.php.
References $file.
71 $expected_variable13 =
new ilSystemStyleLessVariable(
"variable13",
"@variable11",
"comment variable 13",
"Category 1", [
"variable11"]);
73 $expected_variable21 =
new ilSystemStyleLessVariable(
"variable21",
"@variable11",
"comment variable 21",
"Category 2", [
"variable11"]);
75 $expected_variable23 =
new ilSystemStyleLessVariable(
"variable23",
"@variable21",
"comment variable 23",
"Category 2", [
"variable21"]);
77 $this->assertEquals($expected_variable11,
$file->getVariableByName(
"variable11"));
78 $this->assertEquals($expected_variable12,
$file->getVariableByName(
"variable12"));
79 $this->assertEquals($expected_variable13,
$file->getVariableByName(
"variable13"));
81 $this->assertEquals($expected_variable21,
$file->getVariableByName(
"variable21"));
82 $this->assertEquals($expected_variable22,
$file->getVariableByName(
"variable22"));
83 $this->assertEquals($expected_variable23,
$file->getVariableByName(
"variable23"));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetVariableReferences()
ilSkinStyleLessFileTest::testGetVariableReferences |
( |
| ) |
|
Definition at line 222 of file ilSkinStyleLessFileTest.php.
References $file.
225 $this->assertEquals([
"variable13",
"variable21"],
$file->getReferencesToVariable(
"variable11"));
226 $this->assertEquals([],
$file->getReferencesToVariable(
"variable12"));
227 $this->assertEquals([],
$file->getReferencesToVariable(
"variable13"));
229 $this->assertEquals([
"variable23"],
$file->getReferencesToVariable(
"variable21"));
230 $this->assertEquals([],
$file->getReferencesToVariable(
"variable22"));
231 $this->assertEquals([],
$file->getReferencesToVariable(
"variable23"));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testGetVariableReferencesAsString()
ilSkinStyleLessFileTest::testGetVariableReferencesAsString |
( |
| ) |
|
Definition at line 234 of file ilSkinStyleLessFileTest.php.
References $file.
237 $this->assertEquals(
"variable13; variable21; ",
$file->getReferencesToVariableAsString(
"variable11"));
238 $this->assertEquals(
"",
$file->getReferencesToVariableAsString(
"variable12"));
239 $this->assertEquals(
"",
$file->getReferencesToVariableAsString(
"variable13"));
241 $this->assertEquals(
"variable23; ",
$file->getReferencesToVariableAsString(
"variable21"));
242 $this->assertEquals(
"",
$file->getReferencesToVariableAsString(
"variable22"));
243 $this->assertEquals(
"",
$file->getReferencesToVariableAsString(
"variable23"));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testReadCorrectTypes()
ilSkinStyleLessFileTest::testReadCorrectTypes |
( |
| ) |
|
Definition at line 57 of file ilSkinStyleLessFileTest.php.
References $file.
60 $this->assertEquals(2,count(
$file->getCategories()));
61 $this->assertEquals(6,count(
$file->getVariablesIds()));
62 $this->assertEquals(6,count(
$file->getCommentsIds()));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testReadCorrectTypesEdgeCases()
ilSkinStyleLessFileTest::testReadCorrectTypesEdgeCases |
( |
| ) |
|
Definition at line 246 of file ilSkinStyleLessFileTest.php.
References $file.
249 $this->assertEquals(3,count(
$file->getCategories()));
250 $this->assertEquals(7,count(
$file->getVariablesIds()));
251 $this->assertEquals(4,count(
$file->getCommentsIds()));
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testReadWriteDouble()
ilSkinStyleLessFileTest::testReadWriteDouble |
( |
| ) |
|
Definition at line 131 of file ilSkinStyleLessFileTest.php.
References $file.
132 $expected_content = file_get_contents($this->container->getLessVariablesFilePath($this->style->getId()));
140 $this->assertEquals($expected_content,
$file->getContent());
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ testReadWriteDoubleFullLess()
ilSkinStyleLessFileTest::testReadWriteDoubleFullLess |
( |
| ) |
|
Definition at line 143 of file ilSkinStyleLessFileTest.php.
References $file.
144 $expected_content = file_get_contents($this->container->getSkinDirectory().
"full.less");
152 $this->assertEquals($expected_content,
$file->getContent());
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ $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: