function let(View $view, \Widget $widget)
 {
     $view->getWidget()->willReturn($widget);
     $this->beConstructedWith($view);
 }
 /**
  * Handle widget type before return it to support 3rd party form extensions.
  *
  * @param View $view The view.
  *
  * @return string
  */
 private function getWidgetType(View $view)
 {
     $widget = $view->getWidget();
     $type = $view->getWidgetType();
     switch ($type) {
         case 'rocksolid_antispam':
             if ($widget->type === 'captcha') {
                 return $widget->type;
             }
             break;
         default:
             return $type;
     }
     return $type;
 }
Exemplo n.º 3
0
 /**
  * Shortcut to get the widget.
  *
  * @return \Widget
  */
 public function getWidget()
 {
     return $this->view->getWidget();
 }