ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ImportTest.php
Go to the documentation of this file.
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
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);
35EOF
36 );
37
38 return $tests;
39 }
40}
const EOF
How fgetc() reports an End Of File.
Definition: JSMin_lib.php:92
An exception for terminatinating execution or to throw for unit testing.
Represents an import node.
Definition: Import.php:18
$tests
Definition: bench.php:104
$context
Definition: webdav.php:25