@@ 61-76 (lines=16) @@ | ||
58 | ); |
|
59 | } |
|
60 | ||
61 | public function testArrayReturnsResponse() |
|
62 | { |
|
63 | $this->assertInstanceOf( |
|
64 | Response::class, // 5.4 < php |
|
65 | (new TemplatingController(new TwigEngine( |
|
66 | new Twig_Environment(new Twig_Loader_Array([ |
|
67 | 'index.html.twig' => '<ul>{% for item in 0 %}<li>{{ item }}</li>{% endfor %}</ul>', |
|
68 | ])), |
|
69 | new TemplateNameParser() |
|
70 | )))->__invoke([ // This is strange. |
|
71 | 'One', |
|
72 | 'Two', |
|
73 | 'Three', |
|
74 | ]) |
|
75 | ); |
|
76 | } |
|
77 | } |
|
78 | ||
79 | // http://api.symfony.com/3.3/Symfony/Bridge/Twig/TwigEngine.html |
@@ 48-64 (lines=17) @@ | ||
45 | ); |
|
46 | } |
|
47 | ||
48 | public function testArrayReturnsResponse() |
|
49 | { |
|
50 | $this->assertInstanceOf( |
|
51 | // Response::class, // 5.4 < php (code is checked even if not executed!) |
|
52 | 'Symfony\Component\HttpFoundation\Response', |
|
53 | (new VariadicController(new TwigEngine( |
|
54 | new Twig_Environment(new Twig_Loader_Array([ |
|
55 | 'index.html.twig' => '<ul>{% for item in 0 %}<li>{{ item }}</li>{% endfor %}</ul>', |
|
56 | ])), |
|
57 | new TemplateNameParser() |
|
58 | )))->__invoke([ |
|
59 | 'One', |
|
60 | 'Two', |
|
61 | 'Three', |
|
62 | ]) |
|
63 | ); |
|
64 | } |
|
65 | } |
|
66 | ||
67 | // http://api.symfony.com/3.3/Symfony/Bridge/Twig/TwigEngine.html |