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_ArrayTest extends Twig_Test_NodeTestCase
14 public function testConstructor()
16 $elements = array(new Twig_Node_Expression_Constant('foo', 1), $foo = new Twig_Node_Expression_Constant('bar', 1));
17 $node = new Twig_Node_Expression_Array($elements, 1);
19 $this->assertEquals($foo, $node->getNode(1));
22 public function getTests()
25 new Twig_Node_Expression_Constant('foo', 1),
26 new Twig_Node_Expression_Constant('bar', 1),
28 new Twig_Node_Expression_Constant('bar', 1),
29 new Twig_Node_Expression_Constant('foo', 1),
31 $node = new Twig_Node_Expression_Array($elements, 1);
34 array($node, 'array("foo" => "bar", "bar" => "foo")'),