public function testMatchNotFound()
 {
     $app = $this->getApp();
     $handler = new RedirectHandler($app['url_matcher']);
     $config = $this->formFieldConfig();
     $config['redirect']['target'] = '/koala/tree';
     $formConfig = new FormConfig('testing_form', $config);
     $formData = new FormData($this->formData());
     $handler->redirect($formConfig, $formData);
     $this->assertFalse($handler->isValid());
 }
Ejemplo n.º 2
0
 /**
  * Redirect if a redirect is set and the page exists
  *
  * @param FormConfig $formConfig
  * @param FormData   $formData
  */
 protected function processRedirect(FormConfig $formConfig, FormData $formData)
 {
     if ($formConfig->getFeedback()->redirect['target'] !== null) {
         $redirect = new RedirectHandler($this->app['url_matcher']);
         $redirect->redirect($formConfig, $formData);
     }
 }
Ejemplo n.º 3
0
 /**
  * Redirect if a redirect is set and the page exists
  *
  * @param FormConfig $formConfig
  * @param FormData   $formData
  */
 protected function processRedirect(FormConfig $formConfig, FormData $formData)
 {
     if ($formConfig->getFeedback()->redirect['target'] === null) {
         $formConfig->getFeedback()->redirect = array('target' => $this->app['request']->getPathInfo(), 'query' => $formConfig->getFeedback()->redirect['query']);
     }
     $redirect = new RedirectHandler($this->app['url_matcher']);
     $redirect->redirect($formConfig, $formData);
 }