"Fossies" - the Fresh Open Source Software Archive

Member "4.6.1/vendor/mishal-iless/tests/ILess/Test/Issues/036Test.php" (8 Apr 2021, 1118 Bytes) of package /linux/www/studip-4.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 <?php
    2 
    3 /*
    4  * This file is part of the ILess
    5  *
    6  * For the full copyright and license information, please view the LICENSE
    7  * file that was distributed with this source code.
    8  */
    9 use ILess\Parser;
   10 
   11 /**
   12  * Issue #36 test
   13  *
   14  * @package ILess
   15  * @subpackage test
   16  * @group issue
   17  */
   18 class Test_Issues_036Test extends Test_TestCase
   19 {
   20     public function testIssue()
   21     {
   22         $parser = new Parser([
   23             'compress' => false
   24         ]);
   25 
   26         $parser->parseString(
   27 '
   28 @grid-gutter-width: 10px;
   29 .elem {
   30   width: calc(~\'100% + @{grid-gutter-width}\');
   31 }');
   32 
   33         $css = $parser->getCSS();
   34         $expected =
   35 '.elem {
   36   width: calc(100% + 10px);
   37 }
   38 ';
   39         $this->assertEquals($expected, $css);
   40     }
   41 
   42     public function testIssueWithCompression()
   43     {
   44         $parser = new Parser([
   45             'compress' => true
   46         ]);
   47 
   48         $parser->parseString(
   49             '
   50 @grid-gutter-width: 10px;
   51 .elem {
   52   width: calc(~\'100% + @{grid-gutter-width}\');
   53 }');
   54 
   55         $css = $parser->getCSS();
   56         $expected = '.elem{width:calc(100% + 10px)}';
   57         $this->assertEquals($expected, $css);
   58     }
   59 
   60 }