public function testConstructor() { $expr = new Twig_Node_Expression_Constant('foo.twig', 1); $node = new Twig_Node_Include($expr, null, false, false, 1); $this->assertNull($node->getNode('variables')); $this->assertEquals($expr, $node->getNode('expr')); $this->assertFalse($node->getAttribute('only')); $vars = new Twig_Node_Expression_Array(array(new Twig_Node_Expression_Constant('foo', 1), new Twig_Node_Expression_Constant(true, 1)), 1); $node = new Twig_Node_Include($expr, $vars, true, false, 1); $this->assertEquals($vars, $node->getNode('variables')); $this->assertTrue($node->getAttribute('only')); }
public function __construct(\Twig_Node_Include $originalNode, $data) { parent::__construct($originalNode->getNode('expr'), $originalNode->getNode('variables'), $originalNode->getAttribute('only'), $originalNode->getAttribute('ignore_missing'), $originalNode->getLine(), $originalNode->getNodeTag()); $this->setData($data); }