@@ 28-37 (lines=10) @@ | ||
25 | */ |
|
26 | final class TemplatingControllerTest extends TestCase |
|
27 | { |
|
28 | public function testCanBeCreated() |
|
29 | { |
|
30 | $this->assertInstanceOf( |
|
31 | TemplatingController::class, // 5.4 < php |
|
32 | new TemplatingController(new TwigEngine( |
|
33 | new Twig_Environment(new Twig_Loader_Array(['index.html.twig' => 'Hello World!'])), |
|
34 | new TemplateNameParser() |
|
35 | )) |
|
36 | ); |
|
37 | } |
|
38 | ||
39 | public function testHomeCanBeCreated() |
|
40 | { |
|
@@ 39-48 (lines=10) @@ | ||
36 | ); |
|
37 | } |
|
38 | ||
39 | public function testHomeCanBeCreated() |
|
40 | { |
|
41 | $this->assertInstanceOf( |
|
42 | TemplatingController::class, // 5.4 < php |
|
43 | new HomeTemplatingController(new TwigEngine( |
|
44 | new Twig_Environment(new Twig_Loader_Array(['home.html.twig' => 'Hello World!'])), |
|
45 | new TemplateNameParser() |
|
46 | )) |
|
47 | ); |
|
48 | } |
|
49 | ||
50 | public function testEmptyReturnsResponse() |
|
51 | { |
|
@@ 50-59 (lines=10) @@ | ||
47 | ); |
|
48 | } |
|
49 | ||
50 | public function testEmptyReturnsResponse() |
|
51 | { |
|
52 | $this->assertInstanceOf( |
|
53 | Response::class, // 5.4 < php |
|
54 | (new TemplatingController(new TwigEngine( |
|
55 | new Twig_Environment(new Twig_Loader_Array(['index.html.twig' => 'Hello World!'])), |
|
56 | new TemplateNameParser() |
|
57 | )))->__invoke() |
|
58 | ); |
|
59 | } |
|
60 | ||
61 | public function testArrayReturnsResponse() |
|
62 | { |
@@ 24-34 (lines=11) @@ | ||
21 | */ |
|
22 | final class VariadicControllerTest extends TestCase |
|
23 | { |
|
24 | public function testCanBeCreated() |
|
25 | { |
|
26 | $this->assertInstanceOf( |
|
27 | // VariadicController::class, // 5.4 < php (code is checked even if not executed!) |
|
28 | 'SymfonyUtil\Controller\VariadicController', |
|
29 | new VariadicController(new TwigEngine( |
|
30 | new Twig_Environment(new Twig_Loader_Array(['index.html.twig' => 'Hello World!'])), |
|
31 | new TemplateNameParser() |
|
32 | )) |
|
33 | ); |
|
34 | } |
|
35 | ||
36 | public function testEmptyReturnsResponse() |
|
37 | { |
|
@@ 36-46 (lines=11) @@ | ||
33 | ); |
|
34 | } |
|
35 | ||
36 | public function testEmptyReturnsResponse() |
|
37 | { |
|
38 | $this->assertInstanceOf( |
|
39 | // Response::class, // 5.4 < php (code is checked even if not executed!) |
|
40 | 'Symfony\Component\HttpFoundation\Response', |
|
41 | (new VariadicController(new TwigEngine( |
|
42 | new Twig_Environment(new Twig_Loader_Array(['index.html.twig' => 'Hello World!'])), |
|
43 | new TemplateNameParser() |
|
44 | )))->__invoke() |
|
45 | ); |
|
46 | } |
|
47 | ||
48 | public function testArrayReturnsResponse() |
|
49 | { |