You are here

public function Twig_Tests_Node_MacroTest::testConstructor in Zircon Profile 8

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

File

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

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'));
}