From: Arnaud Le Blanc Date: Sat, 12 Nov 2011 10:56:47 +0000 (+0100) Subject: added test for hash keys X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=3f64f1d24ca70694215e07e068de5890fb809682;p=web%2Fkonrad%2Ftwig.git added test for hash keys --- diff --git a/test/Twig/Tests/Fixtures/expressions/array.test b/test/Twig/Tests/Fixtures/expressions/array.test index 8431540..5b81a0e 100644 --- a/test/Twig/Tests/Fixtures/expressions/array.test +++ b/test/Twig/Tests/Fixtures/expressions/array.test @@ -27,6 +27,13 @@ Twig supports array notation 2, ]|join(',') }} + +{# keys can be any expression #} +{% set a = 1 %} +{% set b = "foo" %} +{% set ary = { a: 'a', b: 'b', 'c': 'c', a~b: 'd' } %} +{{ ary|keys|join(',') }} +{{ ary|join(',') }} --DATA-- return array('bar' => 'bar', 'foo' => array('bar' => 'bar')) --EXPECT--