Twig_Environment in Service Class leads to DIC RuntimeExtension only when unittesting in Symfony 2.8 Twig_Environment in Service Class leads to DIC RuntimeExtension only when unittesting in Symfony 2.8 symfony symfony

Twig_Environment in Service Class leads to DIC RuntimeExtension only when unittesting in Symfony 2.8


You should not boot the kernel in the test case's constructor. This way it will be shutdown after the first test has been executed (see https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php#L186-L189). You should rather boot the kernel in the test case's setUp() method.