protected function setUp()
 {
     parent::setUp();
     $loader = new StubFilesystemLoader(array(__DIR__ . '/../../Resources/views/Form', __DIR__ . '/Fixtures/templates/form'));
     $environment = new \Twig_Environment($loader, array('strict_variables' => true));
     $environment->addExtension(new TranslationExtension(new StubTranslator()));
     $environment->addExtension(new FormExtension());
     $rendererEngine = new TwigRendererEngine(array('bootstrap_3_horizontal_layout.html.twig', 'custom_widgets.html.twig'), $environment);
     $this->renderer = new TwigRenderer($rendererEngine, $this->getMock('Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface'));
     $this->registerTwigRuntimeLoader($environment, $this->renderer);
 }
 protected function tearDown()
 {
     parent::tearDown();
     $this->extension = null;
 }