Example #1
0
 /**
  * @covers variable
  */
 public function testVariable()
 {
     // FIXME: implement more!
     $d = new ILess_Node_Directive('15', new ILess_Node_Anonymous('bar'));
     $this->assertEquals(null, $d->variable('foo'));
 }
Example #2
0
 /**
  * Visits a directive node
  *
  * @param ILess_Node_Directive $node The node
  * @param ILess_Visitor_Arguments $arguments The arguments
  * @return ILess_Node_Directive
  */
 public function visitDirective(ILess_Node_Directive $node, ILess_Visitor_Arguments $arguments)
 {
     if ($node->currentFileInfo && $node->currentFileInfo->reference && !$node->isReferenced) {
         return array();
     }
     if ($node->name === '@charset') {
         // Only output the debug info together with subsequent @charset definitions
         // a comment (or @media statement) before the actual @charset directive would
         // be considered illegal css as it has to be on the first line
         if ($this->charset) {
             if ($node->debugInfo) {
                 $comment = new ILess_Node_Comment(sprintf("/* %s */\n", str_replace("\n", '', $node->toCSS($this->getEnvironment()))));
                 $comment->debugInfo = $node->debugInfo;
                 return $this->visit($comment);
             }
             return array();
         }
         $this->charset = true;
     }
     return $node;
 }