/** * @group integration */ public function testFilterLoadWithCompression() { if (!isset($_SERVER['NODE_BIN']) || !isset($_SERVER['NODE_PATH'])) { $this->markTestSkipped('No node.js configuration.'); } $asset = new StringAsset("body\n font 12px Helvetica, Arial, sans-serif\n color black;"); $asset->load(); $filter = new StylusFilter(__DIR__, $_SERVER['NODE_BIN'], array($_SERVER['NODE_PATH'])); $filter->setCompress(true); $filter->filterLoad($asset); $this->assertEquals("body{font:12px Helvetica,Arial,sans-serif;color:#000}\n", $asset->getContent(), '->filterLoad() parses the content and compress it'); }
/** * Filters an asset just before it's dumped. * * @param AssetInterface $asset */ public function filterDump(AssetInterface $asset) { $asset->setContent($this->parser->parse($asset->getContent())); parent::filterLoad($asset); }