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\Expression\Binary\AndBinary;
13use Twig\Node\Expression\ConstantExpression;
14use Twig\Test\NodeTestCase;
15
16class Twig_Tests_Node_Expression_Binary_AndTest extends NodeTestCase
17{
18    public function testConstructor()
19    {
20        $left = new ConstantExpression(1, 1);
21        $right = new ConstantExpression(2, 1);
22        $node = new AndBinary($left, $right, 1);
23
24        $this->assertEquals($left, $node->getNode('left'));
25        $this->assertEquals($right, $node->getNode('right'));
26    }
27
28    public function getTests()
29    {
30        $left = new ConstantExpression(1, 1);
31        $right = new ConstantExpression(2, 1);
32        $node = new AndBinary($left, $right, 1);
33
34        return [
35            [$node, '(1 && 2)'],
36        ];
37    }
38}
39