c1a67a86038291e2f42b46eb583853e66fed97d3
[yaffs-website] / vendor / symfony / expression-language / Tests / Node / ConstantNodeTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
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 namespace Symfony\Component\ExpressionLanguage\Tests\Node;
13
14 use Symfony\Component\ExpressionLanguage\Node\ConstantNode;
15
16 class ConstantNodeTest extends AbstractNodeTest
17 {
18     public function getEvaluateData()
19     {
20         return array(
21             array(false, new ConstantNode(false)),
22             array(true, new ConstantNode(true)),
23             array(null, new ConstantNode(null)),
24             array(3, new ConstantNode(3)),
25             array(3.3, new ConstantNode(3.3)),
26             array('foo', new ConstantNode('foo')),
27             array(array(1, 'b' => 'a'), new ConstantNode(array(1, 'b' => 'a'))),
28         );
29     }
30
31     public function getCompileData()
32     {
33         return array(
34             array('false', new ConstantNode(false)),
35             array('true', new ConstantNode(true)),
36             array('null', new ConstantNode(null)),
37             array('3', new ConstantNode(3)),
38             array('3.3', new ConstantNode(3.3)),
39             array('"foo"', new ConstantNode('foo')),
40             array('array(0 => 1, "b" => "a")', new ConstantNode(array(1, 'b' => 'a'))),
41         );
42     }
43 }