diff options
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test')
-rw-r--r-- | vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test new file mode 100644 index 00000000..0e6fa96e --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test | |||
@@ -0,0 +1,18 @@ | |||
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 | ||