You are here

public function Twig_Tests_Node_IncludeTest::testConstructor in Zircon Profile 8

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

File

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

Class

Twig_Tests_Node_IncludeTest

Code

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