Exemplo n.º 1
0
 protected function setUp()
 {
     parent::setUp();
     $root = realpath(__DIR__ . '/../../../Resources/views/Form');
     $rootCustom = realpath(__DIR__ . '/Resources');
     $templateNameParser = new StubTemplateNameParser($root, $rootCustom);
     $loader = new FilesystemLoader(array());
     $engine = new PhpEngine($templateNameParser, $loader);
     $this->helper = new FormHelper($engine);
     $engine->setHelpers(array($this->helper, new TranslatorHelper(new StubTranslator())));
 }
Exemplo n.º 2
0
 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'));
     $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($this->getMock('Symfony\\Component\\Form\\Extension\\Csrf\\CsrfProvider\\CsrfProviderInterface'), array('form_div_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()
 {
     if (!class_exists('Twig_Environment')) {
         $this->markTestSkipped('Twig is not available.');
     }
     parent::setUp();
     $loader = new StubFilesystemLoader(array(__DIR__ . '/../../../../../../src/Symfony/Bundle/TwigBundle/Resources/views/Form', __DIR__));
     $this->extension = new FormExtension(array('div_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);
 }
Exemplo n.º 5
0
    protected function setUp()
    {
        parent::setUp();

        $loader = new StubFilesystemLoader(array(
            __DIR__.'/../../../../../../src/Symfony/Bundle/TwigBundle/Resources/views/Form',
        ));

        $this->extension = new FormExtension(array('div_layout.html.twig'));

        $environment = new \Twig_Environment($loader);
        $environment->addExtension($this->extension);
        $environment->addExtension(new TranslationExtension(new StubTranslator()));

        $this->extension->initRuntime($environment);
    }