class CompassFilterTest

Compass filter test case.

@author Maxime Thirouin <dev@moox.fr> @group integration

Hierarchy

  • class \Assetic\Test\Filter\CompassFilterTest extends \Assetic\Test\Filter\PHPUnit_Framework_TestCase

Expanded class hierarchy of CompassFilterTest

File

drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CompassFilterTest.php, line 23

Namespace

Assetic\Test\Filter
View source
class CompassFilterTest extends \PHPUnit_Framework_TestCase {
  protected function setUp() {
    if (!isset($_SERVER['COMPASS_BIN'])) {
      $this
        ->markTestSkipped('There is no COMPASS_BIN environment variable.');
    }
  }
  public function testFilterLoadWithScss() {
    $asset = new FileAsset(__DIR__ . '/fixtures/compass/stylesheet.scss');
    $asset
      ->load();
    $filter = new CompassFilter($_SERVER['COMPASS_BIN']);
    $filter
      ->filterLoad($asset);
    $this
      ->assertContains('.test-class', $asset
      ->getContent());
    $this
      ->assertContains('font-size: 2em;', $asset
      ->getContent());
  }
  public function testFilterLoadWithSass() {
    $asset = new FileAsset(__DIR__ . '/fixtures/compass/stylesheet.sass');
    $asset
      ->load();
    $filter = new CompassFilter($_SERVER['COMPASS_BIN']);
    $filter
      ->filterLoad($asset);
    $this
      ->assertContains('.test-class', $asset
      ->getContent());
    $this
      ->assertContains('font-size: 2em;', $asset
      ->getContent());
  }
  public function testCompassMixin() {
    $asset = new FileAsset(__DIR__ . '/fixtures/compass/compass.sass');
    $asset
      ->load();
    $filter = new CompassFilter($_SERVER['COMPASS_BIN']);
    $filter
      ->filterLoad($asset);
    $this
      ->assertContains('text-decoration', $asset
      ->getContent());
  }

}

Members