original_string: public static function mock_submit($simulatedsubmitteddata, $simulatedsubmittedfiles = array(), $method = 'post',
                                         $formidentifier = null) {
          $_FILES = $simulatedsubmittedfiles;
          if ($formidentifier === null) {
              $formidentifier = get_called_class();
              $formidentifier = str_replace('\\', '_', $formidentifier); // See MDL-56233 for more information.
          }
          $simulatedsubmitteddata['_qf__'.$formidentifier] = 1;
          $simulatedsubmitteddata['sesskey'] = sesskey();
          if (strtolower($method) === 'get') {
              $_GET = $simulatedsubmitteddata;
          } else {
              $_POST = $simulatedsubmitteddata;
          }
      }
code: public static function mock_submit($simulatedsubmitteddata, $simulatedsubmittedfiles = array(), $method = 'post',
                                         $formidentifier = null) {
          $_FILES = $simulatedsubmittedfiles;
          if ($formidentifier === null) {
              $formidentifier = get_called_class();
              $formidentifier = str_replace('\\', '_', $formidentifier); // See MDL-56233 for more information.
          }
          $simulatedsubmitteddata['_qf__'.$formidentifier] = 1;
          $simulatedsubmitteddata['sesskey'] = sesskey();
          if (strtolower($method) === 'get') {
              $_GET = $simulatedsubmitteddata;
          } else {
              $_POST = $simulatedsubmitteddata;
          }
      }
code_tokens: public static function mock_submit ( $ simulatedsubmitteddata , $ simulatedsubmittedfiles = array ( ) , $ method = 'post' , $ formidentifier = null ) { $ _FILES = $ simulatedsubmittedfiles ; if ( $ formidentifier === null ) { $ formidentifier = get_called_class ( ) ; $ formidentifier = str_replace ( '\\' , '_' , $ formidentifier ) ; // See MDL-56233 for more information. } $ simulatedsubmitteddata [ '_qf__' . $ formidentifier ] = 1 ; $ simulatedsubmitteddata [ 'sesskey' ] = sesskey ( ) ; if ( strtolower ( $ method ) === 'get' ) { $ _GET = $ simulatedsubmitteddata ; } else { $ _POST = $ simulatedsubmitteddata ; } }
docstring: Used by tests to simulate submitted form data submission from the user.
  
  For form fields where no data is submitted the default for that field as set by set_data or setDefault will be passed to
  get_data.
  
  This method sets $_POST or $_GET and $_FILES with the data supplied. Our unit test code empties all these
  global arrays after each test.
  
  @param array  $simulatedsubmitteddata       An associative array of form values (same format as $_POST).
  @param array  $simulatedsubmittedfiles      An associative array of files uploaded (same format as $_FILES). Can be omitted.
  @param string $method                       'post' or 'get', defaults to 'post'.
  @param null   $formidentifier               the default is to use the class name for this class but you may need to provide
  a different value here for some forms that are used more than once on the
  same page.
docstring_tokens: Used by tests to simulate submitted form data submission from the user .