Security update to Drupal 8.4.6
[yaffs-website] / vendor / twig / twig / test / Twig / Tests / Fixtures / functions / attribute.test
1 --TEST--
2 "attribute" function
3 --TEMPLATE--
4 {{ attribute(obj, method) }}
5 {{ attribute(array, item) }}
6 {{ attribute(obj, "bar", ["a", "b"]) }}
7 {{ attribute(obj, "bar", arguments) }}
8 {{ attribute(obj, method) is defined ? 'ok' : 'ko' }}
9 {{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }}
10 --DATA--
11 return array('obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => array('foo' => 'bar'), 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => array('a', 'b'))
12 --EXPECT--
13 foo
14 bar
15 bar_a-b
16 bar_a-b
17 ok
18 ko