File: method_call.test

package info (click to toggle)
php-twig 3.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,940 kB
  • sloc: php: 23,320; makefile: 110; sh: 43
file content (34 lines) | stat: -rw-r--r-- 634 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
Twig supports method calls
--TEMPLATE--
{{ items.foo.foo }}
{{ items.foo.getFoo() }}
{{ items.foo.bar }}
{{ items.foo['bar'] }}
{{ items.foo.bar('a', 43) }}
{{ items.foo.bar(param1: 'a', param2: 43) }}
{{ items.foo.bar(param2: 43, param1: 'a') }}
{{ items.foo.bar('a', param2: 43) }}
{{ items.foo.bar(foo) }}
{{ items.foo.self.foo() }}
{{ items.foo.is }}
{{ items.foo.in }}
{{ items.foo.not }}
--DATA--
return ['foo' => 'bar', 'items' => ['foo' => new Twig\Tests\TwigTestFoo(), 'bar' => 'foo']]
--CONFIG--
return ['strict_variables' => false]
--EXPECT--
foo
foo
bar

bar_a-43
bar_a-43
bar_a-43
bar_a-43
bar_bar
foo
is
in
not