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;
 }
 /**
  * Shortcut to get the errors.
  *
  * @return \Netzmacht\Contao\FormHelper\Partial\Errors
  */
 public function getErrors()
 {
     return $this->view->getErrors();
 }