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\DoNode;
13use Twig\Node\Expression\ConstantExpression;
14use Twig\Test\NodeTestCase;
15
16class Twig_Tests_Node_DoTest extends NodeTestCase
17{
18    public function testConstructor()
19    {
20        $expr = new ConstantExpression('foo', 1);
21        $node = new DoNode($expr, 1);
22
23        $this->assertEquals($expr, $node->getNode('expr'));
24    }
25
26    public function getTests()
27    {
28        $tests = [];
29
30        $expr = new ConstantExpression('foo', 1);
31        $node = new DoNode($expr, 1);
32        $tests[] = [$node, "// line 1\n\"foo\";"];
33
34        return $tests;
35    }
36}
37