/** * @covers addFunction */ public function testCustomFunction() { $registry = new ILess_FunctionRegistry(); $registry->addFunction('foobar', array($this, 'foobarCallable')); $registry->call('foobar', array('a', 'b')); }
/** * Sets the function registry, also links the registry with this environment instance * * @param ILess_FunctionRegistry $registry * @return ILess_Environment */ public function setFunctionRegistry(ILess_FunctionRegistry $registry) { $this->functionRegistry = $registry; // provide access to the environment, which is need to access generateCSS() $this->functionRegistry->setEnvironment($this); return $this; }