public function testCssEmbedMhtml() { $asset = new FileAsset(__DIR__ . '/fixtures/cssembed/test.css'); $asset->load(); $filter = new CssEmbedFilter($_SERVER['CSSEMBED_JAR']); $filter->setMhtml(true); $filter->setMhtmlRoot('/test'); $filter->filterDump($asset); $this->assertContains('url(mhtml:/test/!', $asset->getContent()); }
protected function _setup_filters() { $config = $this->_get_config(); // Stylesheet filters $less = new LessFilter($config['node_path'], $config['node_paths']); $styl = new StylusFilter($config['node_path'], $config['node_paths']); // Enable compression if ($this->_is_debug() === false) { $less->setCompress(true); $styl->setCompress(true); } $this->_add_filter('less', $less); $this->_add_filter('styl', $styl); $css_embed = new CssEmbedFilter($config['cssembed_path']); if ($config['cssembed_root'] !== false) { $css_embed->setRoot($config['cssembed_root']); } $css_embed->setMhtml(false); $css_embed->setCharset('utf8'); $this->_add_filter('css_embed', $css_embed); $css_rewrite = new MyCssRewriteFilter($config['css_rewrite_replacement'], $config['css_rewrite_pattern']); $this->_add_filter('css_rewrite', $css_rewrite); // Javascript filters $this->_add_filter('yui_js', new Yui\JsCompressorFilter($config['yuicompressor_path'])); $this->_add_filter('coffee', new CoffeeScriptFilter($config['coffee_path'], $config['node_path'])); // Javascript template filters $this->_add_filter('handlebars', new HandlebarsFilter($config['handlebars_path'], $config['node_path'])); $this->_add_filter('underscore', new UnderscoreFilter($config['underscore_namespace']), $config['underscore_ext']); }