public function Twig_Tests_Node_MacroTest::testConstructor

@covers Twig_Node_Macro::__construct

File

drupal/core/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php, line 17

Class

Twig_Tests_Node_MacroTest

Code

public function testConstructor() {
  $body = new Twig_Node_Text('foo', 1);
  $arguments = new Twig_Node(array(
    new Twig_Node_Expression_Name('foo', 1),
  ), array(), 1);
  $node = new Twig_Node_Macro('foo', $body, $arguments, 1);
  $this
    ->assertEquals($body, $node
    ->getNode('body'));
  $this
    ->assertEquals($arguments, $node
    ->getNode('arguments'));
  $this
    ->assertEquals('foo', $node
    ->getAttribute('name'));
}