/** * @covers generateCss */ public function testGenerateCss() { $env = new ILess_Environment(); $output = new ILess_Output(); $v = new ILess_Node_Value(array(new ILess_Node_Anonymous('foobar'))); $v->generateCss($env, $output); $this->assertEquals('foobar', $output->toString()); }
/** * @see ILess_Node */ public function compile(ILess_Environment $env, $arguments = null, $important = null) { $media = new ILess_Node_Media(array(), array(), $this->index, $this->currentFileInfo); if ($this->debugInfo) { $this->rules[0]->debugInfo = $this->debugInfo; $media->debugInfo = $this->debugInfo; } $strictMathBypass = false; if (!$env->strictMath) { $strictMathBypass = true; $env->strictMath = true; } try { $media->features = $this->features->compile($env); } catch (Exception $e) { // empty on purpose } if ($strictMathBypass) { $env->strictMath = false; } $env->mediaPath[] = $media; $env->mediaBlocks[] = $media; array_unshift($env->frames, $this->rules[0]); $media->rules = array($this->rules[0]->compile($env)); array_shift($env->frames); array_pop($env->mediaPath); return count($env->mediaPath) == 0 ? $media->compileTop($env) : $media->compileNested($env); }