/** * @param \Symfony\Component\Form\FormView $view * @param \Symfony\Component\Form\FormInterface $form * @param array $options */ public function buildView(FormView $view, FormInterface $form, array $options) { if (isset($view->vars['file_url']) && null !== $options['im_format']) { $view->vars['file_url'] = $this->imManager->getUrl($options['im_format'], $view->vars['file_url']); } }
/** * @param Manager $manager * * @depends test__construct */ public function testGetUrl(Manager $manager) { $format = 'someformat'; $path = 'somepath'; $this->assertEquals($this->cachePath . '/' . $format . '/' . $path, $manager->getUrl($format, $path)); $manager->setCachePath('somepath/'); $this->assertEquals('somepath/' . $format . '/' . $path, $manager->getUrl($format, $path)); $manager->setCachePath($this->cachePath); }