You are here

public function Twig_Tests_Node_ModuleTest::testConstructor in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php \Twig_Tests_Node_ModuleTest::testConstructor()

File

vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php, line 14

Class

Twig_Tests_Node_ModuleTest

Code

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();
  $filename = 'foo.twig';
  $node = new Twig_Node_Module($body, $parent, $blocks, $macros, $traits, new Twig_Node(array()), $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'));
}