diff options
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php')
-rw-r--r-- | vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php new file mode 100644 index 00000000..12bb35c9 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.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_MulTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_Mul::__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_Mul($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_Mul::compile | ||
29 | * @covers Twig_Node_Expression_Binary_Mul::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_Mul($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 * 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||