Yaffs site version 1.1
[yaffs-website] / vendor / twig / twig / test / Twig / Tests / Node / ImportTest.php
1 <?php
2
3 /*
4  * This file is part of Twig.
5  *
6  * (c) Fabien Potencier
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 class Twig_Tests_Node_ImportTest extends Twig_Test_NodeTestCase
13 {
14     public function testConstructor()
15     {
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);
19
20         $this->assertEquals($macro, $node->getNode('expr'));
21         $this->assertEquals($var, $node->getNode('var'));
22     }
23
24     public function getTests()
25     {
26         $tests = array();
27
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);
31
32         $tests[] = array($node, <<<EOF
33 // line 1
34 \$context["macro"] = \$this->loadTemplate("foo.twig", null, 1);
35 EOF
36         );
37
38         return $tests;
39     }
40 }