protected function setUp() { parent::setUp(); $root = realpath(__DIR__ . '/../../../Resources/views'); $rootTheme = realpath(__DIR__ . '/Resources'); $templateNameParser = new StubTemplateNameParser($root, $rootTheme); $loader = new FilesystemLoader(array()); $engine = new PhpEngine($templateNameParser, $loader); $this->helper = new FormHelper($engine, $this->getMock('Symfony\\Component\\Form\\Extension\\Csrf\\CsrfProvider\\CsrfProviderInterface'), array('FrameworkBundle:Form', 'FrameworkBundle:FormTable')); $engine->setHelpers(array($this->helper, new TranslatorHelper(new StubTranslator()))); }
protected function setUp() { parent::setUp(); $root = realpath(__DIR__ . '/../../../Resources/views'); $rootTheme = realpath(__DIR__ . '/Resources'); $templateNameParser = new StubTemplateNameParser($root, $rootTheme); $loader = new FilesystemLoader(array()); $engine = new PhpEngine($templateNameParser, $loader); $this->helper = new FormHelper($engine, array('FrameworkBundle:Form', 'FrameworkBundle:FormTable')); $engine->setHelpers(array($this->helper, new TranslatorHelper(new StubTranslator()))); }
protected function setUp() { if (!class_exists('Twig_Environment')) { $this->markTestSkipped('Twig is not available.'); } parent::setUp(); $loader = new StubFilesystemLoader(array(__DIR__ . '/../../../../../../src/Symfony/Bridge/Twig/Resources/views/Form', __DIR__)); $this->extension = new FormExtension(array('table_layout.html.twig', 'custom_widgets.html.twig')); $environment = new \Twig_Environment($loader); $environment->addExtension($this->extension); $environment->addExtension(new TranslationExtension(new StubTranslator())); $this->extension->initRuntime($environment); }
protected function setUp() { parent::setUp(); $loader = new StubFilesystemLoader(array( __DIR__.'/../../../../../../src/Symfony/Bundle/TwigBundle/Resources/views/Form', )); $this->extension = new FormExtension(array('table_layout.html.twig')); $environment = new \Twig_Environment($loader); $environment->addExtension($this->extension); $environment->addExtension(new TranslationExtension(new StubTranslator())); $this->extension->initRuntime($environment); }
protected function tearDown() { parent::tearDown(); $this->extension = null; }