4 * This file is part of Twig.
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 class Twig_Tests_Node_Expression_Binary_OrTest
extends Twig_Test_NodeTestCase
15 * @covers Twig_Node_Expression_Binary_Or::__construct
17 public function testConstructor()
19 $left = new Twig_Node_Expression_Constant(1, 1);
20 $right = new Twig_Node_Expression_Constant(2, 1);
21 $node = new Twig_Node_Expression_Binary_Or($left, $right, 1);
23 $this->assertEquals($left, $node->getNode('left'));
24 $this->assertEquals($right, $node->getNode('right'));
28 * @covers Twig_Node_Expression_Binary_Or::compile
29 * @covers Twig_Node_Expression_Binary_Or::operator
30 * @dataProvider getTests
32 public function testCompile($node, $source, $environment = null)
34 parent
::testCompile($node, $source, $environment);
37 public function getTests()
39 $left = new Twig_Node_Expression_Constant(1, 1);
40 $right = new Twig_Node_Expression_Constant(2, 1);
41 $node = new Twig_Node_Expression_Binary_Or($left, $right, 1);
44 array($node, '(1 || 2)'),