4 * This file is part of Twig.
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 class Twig_Tests_Node_ImportTest extends Twig_Test_NodeTestCase
14 public function testConstructor()
16 $macro = new Twig_Node_Expression_Constant('foo.twig', 1);
17 $var = new Twig_Node_Expression_AssignName('macro', 1);
18 $node = new Twig_Node_Import($macro, $var, 1);
20 $this->assertEquals($macro, $node->getNode('expr'));
21 $this->assertEquals($var, $node->getNode('var'));
24 public function getTests()
28 $macro = new Twig_Node_Expression_Constant('foo.twig', 1);
29 $var = new Twig_Node_Expression_AssignName('macro', 1);
30 $node = new Twig_Node_Import($macro, $var, 1);
32 $tests[] = array($node, <<<EOF
34 \$context["macro"] = \$this->loadTemplate("foo.twig", null, 1);