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