"Fossies" - the Fresh Open Source Software Archive

Member "4.6.1/vendor/mishal-iless/tests/ILess/Test/Issues/039Test.php" (8 Apr 2021, 1484 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 #39 test
   13  *
   14  * @package ILess
   15  * @subpackage test
   16  * @group issue
   17  */
   18 class Test_Issues_039Test extends Test_TestCase
   19 {
   20     public function testIssue()
   21     {
   22         $parser = new Parser([
   23             'compress' => false
   24         ]);
   25 
   26         $parser->parseString(
   27             '
   28 @screen-md-min: 460px;
   29 @media (min-width: @screen-md-min) {
   30     body { color: red; }
   31 }
   32 ');
   33 
   34         $css = $parser->getCSS();
   35         $expected =
   36             '@media (min-width: 460px) {
   37   body {
   38     color: red;
   39   }
   40 }
   41 ';
   42         $this->assertEquals($expected, $css);
   43     }
   44 
   45     public function testIssueWithCompression()
   46     {
   47         $parser = new Parser([
   48             'compress' => true
   49         ]);
   50 
   51         $parser->parseString(
   52             '
   53 @screen-md-min: 460px;
   54 @media (min-width: @screen-md-min) {
   55     body { color: red; }
   56 }');
   57 
   58         $css = $parser->getCSS();
   59         $expected = '@media (min-width:460px){body{color:red}}';
   60         $this->assertEquals($expected, $css);
   61     }
   62 
   63     public function testEmptyMediaDeclaration()
   64     {
   65         $parser = new Parser([
   66             'compress' => false
   67         ]);
   68 
   69         $parser->parseString('@media (min-width: 640px) {}');
   70 
   71         $css = $parser->getCSS();
   72         $expected = '';
   73 
   74         $this->assertEquals($expected, $css);
   75     }
   76 
   77 }