/**
  * 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['autoprefixer'] = $app->share(function () use($app) {
             $filter = new AutoprefixerFilter($app['assetic.filter.autoprefixer.bin']);
             $filter->setTimeout($app['assetic.filter.autoprefixer.timeout']);
             $filter->setNodePaths($app['assetic.filter.autoprefixer.node_paths']);
             $filter->setBrowsers($app['assetic.filter.autoprefixer.browsers']);
             return $filter;
         });
         return $filters;
     }));
 }
예제 #2
0
    public function testAddBrowser()
    {
        $input = <<<CSS
img {
  border-radius: 10px;
}
CSS;
        $expected = <<<CSS
img {
  -moz-border-radius: 10px;
       border-radius: 10px;
}
CSS;
        $asset = new StringAsset($input);
        $asset->load();
        $this->filter->addBrowser('ff 3');
        $this->filter->filterLoad($asset);
        $this->assertEquals($expected, $asset->getContent());
    }