diff options
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php')
-rw-r--r-- | vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php new file mode 100644 index 00000000..50e551a7 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php | |||
@@ -0,0 +1,47 @@ | |||
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 | |||
12 | class Twig_Tests_Node_Expression_Binary_AndTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_And::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
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_And($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_And::compile | ||
29 | * @covers Twig_Node_Expression_Binary_And::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
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_And($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 && 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||