]> git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test
0e6fa96e254fab5f1a6a36c513f5bea0be7de937
[github/wallabag/wallabag.git] / vendor / twig / twig / test / Twig / Tests / Fixtures / expressions / ternary_operator.test
1 --TEST--
2 Twig supports the ternary operator
3 --TEMPLATE--
4 {{ 1 ? 'YES' : 'NO' }}
5 {{ 0 ? 'YES' : 'NO' }}
6 {{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }}
7 {{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }}
8 {{ 1 == 1 ? 'foo<br />':'' }}
9 {{ foo ~ (bar ? ('-' ~ bar) : '') }}
10 --DATA--
11 return array('foo' => 'foo', 'bar' => 'bar')
12 --EXPECT--
13 YES
14 NO
15 YES1
16 NO1
17 foo<br />
18 foo-bar