Example #1
0
 public function testRelativeSourceUrlImportImports()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/cssmin/main.css');
     $asset->load();
     $filter = new CssMinFilter(__DIR__ . '/fixtures/cssmin');
     $filter->setFilter('ImportImports', true);
     $filter->filterDump($asset);
     $this->assertEquals('body{color:white}body{background:black}', $asset->getContent());
 }
 /**
  * Bootstraps the application.
  *
  * This method is called after all services are registered
  * and should be used for "dynamic" configuration (whenever
  * a service must be requested).
  *
  * @param  Application $app
  * @throws \InvalidArgumentException
  */
 public function boot(Application $app)
 {
     $app['assetic.filters'] = $app->share($app->extend('assetic.filters', function ($filters) use($app) {
         $filters['cssmin'] = $app->share(function () use($app) {
             $filter = new CssMinFilter();
             $filter->setFilters($app['assetic.filter.cssmin.filters']);
             $filter->setPlugins($app['assetic.filter.cssmin.plugins']);
             return $filter;
         });
         return $filters;
     }));
 }