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
12use Twig\Node\AutoEscapeNode;
13use Twig\Node\Node;
14use Twig\Node\TextNode;
15use Twig\Test\NodeTestCase;
16
17class Twig_Tests_Node_AutoEscapeTest extends NodeTestCase
18{
19    public function testConstructor()
20    {
21        $body = new Node([new TextNode('foo', 1)]);
22        $node = new AutoEscapeNode(true, $body, 1);
23
24        $this->assertEquals($body, $node->getNode('body'));
25        $this->assertTrue($node->getAttribute('value'));
26    }
27
28    public function getTests()
29    {
30        $body = new Node([new TextNode('foo', 1)]);
31        $node = new AutoEscapeNode(true, $body, 1);
32
33        return [
34            [$node, "// line 1\necho \"foo\";"],
35        ];
36    }
37}
38