original_string: private function guess_type() {
          global $CFG;
  
          // We default to the text-based field if nothing was detected.
          if (!$type = behat_field_manager::guess_field_type($this->field, $this->session)) {
              $type = 'text';
          }
  
          $classname = 'behat_form_' . $type;
          $classpath = $CFG->dirroot . '/lib/behat/form_field/' . $classname . '.php';
          require_once($classpath);
          return new $classname($this->session, $this->field);
      }
code: private function guess_type() {
          global $CFG;
  
          // We default to the text-based field if nothing was detected.
          if (!$type = behat_field_manager::guess_field_type($this->field, $this->session)) {
              $type = 'text';
          }
  
          $classname = 'behat_form_' . $type;
          $classpath = $CFG->dirroot . '/lib/behat/form_field/' . $classname . '.php';
          require_once($classpath);
          return new $classname($this->session, $this->field);
      }
code_tokens: private function guess_type ( ) { global $ CFG ; // We default to the text-based field if nothing was detected. if ( ! $ type = behat_field_manager :: guess_field_type ( $ this -> field , $ this -> session ) ) { $ type = 'text' ; } $ classname = 'behat_form_' . $ type ; $ classpath = $ CFG -> dirroot . '/lib/behat/form_field/' . $ classname . '.php' ; require_once ( $ classpath ) ; return new $ classname ( $ this -> session , $ this -> field ) ; }
docstring: Guesses the element type we are dealing with in case is not a text-based element.
  
  This class is the generic field type, behat_field_manager::get_form_field()
  should be able to find the appropiate class for the field type, but
  in cases like moodle form group elements we can not find the type of
  the field through the DOM so we also need to take care of the
  different field types from here. If we need to deal with more complex
  moodle form elements we will need to refactor this simple HTML elements
  guess method.
  
  @return behat_form_field
docstring_tokens: Guesses the element type we are dealing with in case is not a text - based element .