コード例 #1
0
 public function __construct(Twig_Node_Module $node, array $usedFilters, array $usedTags, array $usedFunctions)
 {
     parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getAttribute('filename'), $node->getLine(), $node->getNodeTag());
     $this->usedFilters = $usedFilters;
     $this->usedTags = $usedTags;
     $this->usedFunctions = $usedFunctions;
 }
コード例 #2
0
 public function __construct(Twig_Node_Module $node, array $usedFilters, array $usedTags, array $usedFunctions)
 {
     parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('embedded_templates'), $node->getAttribute('filename'));
     $this->setAttribute('index', $node->getAttribute('index'));
     $this->usedFilters = $usedFilters;
     $this->usedTags = $usedTags;
     $this->usedFunctions = $usedFunctions;
 }
コード例 #3
0
ファイル: ModuleTest.php プロジェクト: vebnz/lifelitup
 /**
  * @covers Twig_Node_Module::__construct
  */
 public function testConstructor()
 {
     $body = new Twig_Node_Text('foo', 0);
     $parent = new Twig_Node_Expression_Constant('layout.twig', 0);
     $blocks = new Twig_Node();
     $macros = new Twig_Node();
     $filename = 'foo.twig';
     $node = new Twig_Node_Module($body, $parent, $blocks, $macros, $filename);
     $this->assertEquals($body, $node->getNode('body'));
     $this->assertEquals($blocks, $node->getNode('blocks'));
     $this->assertEquals($macros, $node->getNode('macros'));
     $this->assertEquals($parent, $node->getNode('parent'));
     $this->assertEquals($filename, $node->getAttribute('filename'));
 }
コード例 #4
0
ファイル: ModuleTest.php プロジェクト: naldz/cyberden
 public function testConstructor()
 {
     $body = new Twig_Node_Text('foo', 1);
     $parent = new Twig_Node_Expression_Constant('layout.twig', 1);
     $blocks = new Twig_Node();
     $macros = new Twig_Node();
     $traits = new Twig_Node();
     $source = new Twig_Source('{{ foo }}', 'foo.twig');
     $node = new Twig_Node_Module($body, $parent, $blocks, $macros, $traits, new Twig_Node(array()), $source);
     $this->assertEquals($body, $node->getNode('body'));
     $this->assertEquals($blocks, $node->getNode('blocks'));
     $this->assertEquals($macros, $node->getNode('macros'));
     $this->assertEquals($parent, $node->getNode('parent'));
     $this->assertEquals($source->getName(), $node->getTemplateName());
 }