File: simple.test

package info (click to toggle)
php-twig 3.5.1-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,560 kB
  • sloc: php: 17,829; makefile: 106; sh: 42
file content (22 lines) | stat: -rw-r--r-- 353 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
macro
--TEMPLATE--
{% import _self as test %}
{% from _self import test %}

{% macro test(a, b) -%}
    {{ a|default('a') }}<br />
    {{- b|default('b') }}<br />
{%- endmacro %}

{{ test.test() }}
{{ test() }}
{{ test.test(1, "c") }}
{{ test(1, "c") }}
--DATA--
return []
--EXPECT--
a<br />b<br />
a<br />b<br />
1<br />c<br />
1<br />c<br />