◆ testAddAndWriteItems()
ilSystemStyleStyleLessFileTest::testAddAndWriteItems |
( |
| ) |
|
Definition at line 291 of file ilSystemStyleStyleLessFileTest.php.
301 'comment variable 11',
308 'comment variable 12',
315 'comment variable 13',
327 'comment variable 21',
334 'comment variable 22',
341 'comment variable 23',
346 $expected_items = [$expected_category1,
349 $expected_variable11,
350 $expected_variable12,
351 $expected_variable13,
357 $expected_variable21,
358 $expected_variable22,
362 foreach ($expected_items as $item) {
363 $empty_less->addItem($item);
365 $empty_less->write();
368 $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 215 of file ilSystemStyleStyleLessFileTest.php.
217 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
218 $variable = $file->getVariableByName(
'variable11');
219 $variable->setValue(
'newvalue11');
227 'comment variable 11',
234 'comment variable 12',
241 'comment variable 13',
253 'comment variable 21',
260 'comment variable 22',
267 'comment variable 23',
272 $expected_items = [$expected_category1,
275 $expected_variable11,
276 $expected_variable12,
277 $expected_variable13,
283 $expected_variable21,
284 $expected_variable22,
288 $this->assertEquals($expected_items, $file->getItems());
Capsules data of a less category in the variables to less file.
◆ testConstructAndRead()
ilSystemStyleStyleLessFileTest::testConstructAndRead |
( |
| ) |
|
◆ testGetCategory()
ilSystemStyleStyleLessFileTest::testGetCategory |
( |
| ) |
|
Definition at line 97 of file ilSystemStyleStyleLessFileTest.php.
103 $expected_categories = [$expected_category1, $expected_category2];
105 $this->assertEquals($expected_categories, $file->getCategories());
Capsules data of a less category in the variables to less file.
◆ testGetContent()
ilSystemStyleStyleLessFileTest::testGetContent |
( |
| ) |
|
Definition at line 182 of file ilSystemStyleStyleLessFileTest.php.
184 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
185 $expected_content = file_get_contents($this->container->getLessVariablesFilePath($this->style->getId()));
186 $this->assertEquals($expected_content, $file->getContent());
◆ testGetItems()
ilSystemStyleStyleLessFileTest::testGetItems |
( |
| ) |
|
Definition at line 108 of file ilSystemStyleStyleLessFileTest.php.
110 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
118 'comment variable 11',
125 'comment variable 12',
132 'comment variable 13',
144 'comment variable 21',
151 'comment variable 22',
158 'comment variable 23',
163 $expected_items = [$expected_category1,
166 $expected_variable11,
167 $expected_variable12,
168 $expected_variable13,
174 $expected_variable21,
175 $expected_variable22,
179 $this->assertEquals($expected_items, $file->getItems());
Capsules data of a less category in the variables to less file.
◆ testGetItemsEdgeCases()
ilSystemStyleStyleLessFileTest::testGetItemsEdgeCases |
( |
| ) |
|
Definition at line 406 of file ilSystemStyleStyleLessFileTest.php.
414 'variableNoCategory1',
416 'comment variable 11',
425 'variableNoValidSection1',
428 'Category 1 no valid section',
432 'variableNoValidSection2',
435 'Category 1 no valid section',
446 'Hard references id',
452 'floor((@regular * 1.6)) * lighten(@regular, 20%)',
463 $expected_items = [$expected_comment1,
465 $expected_variable11,
466 $expected_variable12,
468 $expected_variable21,
469 $expected_variable22,
472 $expected_variable31,
473 $expected_variable32,
479 $this->assertEquals($expected_items, $file->getItems());
Capsules data of a less category in the variables to less file.
◆ testGetVariableByName()
ilSystemStyleStyleLessFileTest::testGetVariableByName |
( |
| ) |
|
Definition at line 40 of file ilSystemStyleStyleLessFileTest.php.
47 'comment variable 11',
54 'comment variable 12',
61 'comment variable 13',
69 'comment variable 21',
76 'comment variable 22',
83 'comment variable 23',
88 $this->assertEquals($expected_variable11, $file->getVariableByName(
'variable11'));
89 $this->assertEquals($expected_variable12, $file->getVariableByName(
'variable12'));
90 $this->assertEquals($expected_variable13, $file->getVariableByName(
'variable13'));
92 $this->assertEquals($expected_variable21, $file->getVariableByName(
'variable21'));
93 $this->assertEquals($expected_variable22, $file->getVariableByName(
'variable22'));
94 $this->assertEquals($expected_variable23, $file->getVariableByName(
'variable23'));
◆ testGetVariableReferences()
ilSystemStyleStyleLessFileTest::testGetVariableReferences |
( |
| ) |
|
Definition at line 371 of file ilSystemStyleStyleLessFileTest.php.
373 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
375 $this->assertEquals([
'variable13',
'variable21'], $file->getReferencesToVariable(
'variable11'));
376 $this->assertEquals([], $file->getReferencesToVariable(
'variable12'));
377 $this->assertEquals([], $file->getReferencesToVariable(
'variable13'));
379 $this->assertEquals([
'variable23'], $file->getReferencesToVariable(
'variable21'));
380 $this->assertEquals([], $file->getReferencesToVariable(
'variable22'));
381 $this->assertEquals([], $file->getReferencesToVariable(
'variable23'));
◆ testGetVariableReferencesAsString()
ilSystemStyleStyleLessFileTest::testGetVariableReferencesAsString |
( |
| ) |
|
Definition at line 384 of file ilSystemStyleStyleLessFileTest.php.
386 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
388 $this->assertEquals(
'variable13; variable21; ', $file->getReferencesToVariableAsString(
'variable11'));
389 $this->assertEquals(
'', $file->getReferencesToVariableAsString(
'variable12'));
390 $this->assertEquals(
'', $file->getReferencesToVariableAsString(
'variable13'));
392 $this->assertEquals(
'variable23; ', $file->getReferencesToVariableAsString(
'variable21'));
393 $this->assertEquals(
'', $file->getReferencesToVariableAsString(
'variable22'));
394 $this->assertEquals(
'', $file->getReferencesToVariableAsString(
'variable23'));
◆ testReadCorrectTypes()
ilSystemStyleStyleLessFileTest::testReadCorrectTypes |
( |
| ) |
|
Definition at line 31 of file ilSystemStyleStyleLessFileTest.php.
35 $this->assertCount(2, $file->getCategories());
36 $this->assertCount(6, $file->getVariablesIds());
37 $this->assertCount(6, $file->getCommentsIds());
◆ testReadCorrectTypesEdgeCases()
ilSystemStyleStyleLessFileTest::testReadCorrectTypesEdgeCases |
( |
| ) |
|
Definition at line 397 of file ilSystemStyleStyleLessFileTest.php.
401 $this->assertCount(3, $file->getCategories());
402 $this->assertCount(7, $file->getVariablesIds());
403 $this->assertCount(4, $file->getCommentsIds());
◆ testReadWriteDouble()
ilSystemStyleStyleLessFileTest::testReadWriteDouble |
( |
| ) |
|
Definition at line 189 of file ilSystemStyleStyleLessFileTest.php.
191 $expected_content = file_get_contents($this->container->getLessVariablesFilePath($this->style->getId()));
193 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
195 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
197 $file =
new ilSystemStyleLessFile($this->container->getLessVariablesFilePath($this->style->getId()));
199 $this->assertEquals($expected_content, $file->getContent());
◆ testReadWriteDoubleFullLess()
ilSystemStyleStyleLessFileTest::testReadWriteDoubleFullLess |
( |
| ) |
|
Definition at line 202 of file ilSystemStyleStyleLessFileTest.php.
References ilSystemStyleLessFile\write().
204 $expected_content = file_get_contents($this->container->getSkinDirectory() .
'full.less');
212 $this->assertEquals($expected_content, $file->getContent());
write()
Write the complete file back to the file system (including comments and random content) ...
The documentation for this class was generated from the following file: