public function testGet() { $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); $container->expects($this->exactly(2))->method('get')->with('assetic.filter.bar')->will($this->returnValue($filter)); $fm = new FilterManager($container, array('foo' => 'assetic.filter.bar')); $this->assertSame($filter, $fm->get('foo'), '->get() loads the filter from the container'); $this->assertSame($filter, $fm->get('foo'), '->get() loads the filter from the container'); }
public function inject(FilterManager $manager, array $variables = []) { if ($manager->has('lessphp')) { $lessphp = $manager->get('lessphp'); $lessphp->setPresets($variables); } }
public function inject(FilterManager $manager, array $variables = []) { if ($manager->has('less')) { $less = $manager->get('less'); $less->addParserOption('globalVars', $this->sanitize($variables)); } }