public function CoffeeScriptFilterTest::testFilterLoad

File

drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CoffeeScriptFilterTest.php, line 33

Class

CoffeeScriptFilterTest
@group integration

Namespace

Assetic\Test\Filter

Code

public function testFilterLoad() {
  $expected = <<<JAVASCRIPT
(function() {
  var square;

  square = function(x) {
    return x * x;
  };

}).call(this);

JAVASCRIPT;
  $asset = new StringAsset('square = (x) -> x * x');
  $asset
    ->load();
  $this->filter
    ->filterLoad($asset);
  $this
    ->assertEquals($expected, $asset
    ->getContent());
}