function generate($code_writer)
 {
     if (self::$trim) {
         $code_writer->writeHtml(trim($this->contents));
     } else {
         $code_writer->writeHtml($this->contents);
     }
     parent::generate($code_writer);
 }
 function testDuplicateIdsError()
 {
     $root = new lmbMacroNode();
     $child1 = new lmbMacroNode(new lmbMacroSourceLocation('my_file', 10));
     $child1->setNodeId('my_tag');
     $root->addChild($child1);
     $child2 = new lmbMacroNode(new lmbMacroSourceLocation('my_file2', 15));
     $child2->setNodeId('my_tag');
     $root->addChild($child2);
     try {
         $root->checkChildrenIds();
         $this->assertTrue(false);
     } catch (lmbMacroException $e) {
         $this->assertPattern('/Duplicate "id" attribute/', $e->getMessage());
         $params = $e->getParams();
         $this->assertEqual($params['file'], 'my_file2');
         $this->assertEqual($params['line'], 15);
         $this->assertEqual($params['duplicate_node_file'], 'my_file');
         $this->assertEqual($params['duplicate_node_line'], 10);
     }
 }
 function __construct($location, $expression = null)
 {
     $this->expression = $expression;
     parent::__construct($location);
 }
Example #4
0
 function raise($error, $vars = array())
 {
     $vars['tag'] = $this->tag;
     parent::raise($error, $vars);
 }