public function GssFilterTest::testCompile

File

drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GssFilterTest.php, line 22

Class

GssFilterTest
@group integration

Namespace

Assetic\Test\Filter\GoogleClosure

Code

public function testCompile() {
  if (!isset($_SERVER['GSS_JAR'])) {
    $this
      ->markTestSkipped('There is no GSS_JAR environment variable.');
  }
  $input = <<<EOF
@def BG_COLOR rgb(235, 239, 249);
body {background-color: BG_COLOR;}
EOF;
  $expected = <<<EOF
body{background-color:#ebeff9}
EOF;
  $asset = new StringAsset($input);
  $asset
    ->load();
  $filter = new GssFilter($_SERVER['GSS_JAR']);
  $filter
    ->filterLoad($asset);
  $this
    ->assertEquals($expected, $asset
    ->getContent());
}