original_string: public static function update_config_file($component = '', $testsrunner = true, $tags = '',
          $themesuitewithallfeatures = false, $parallelruns = 0, $run = 0) {
  
          global $CFG;
  
          // Behat must have a separate behat.yml to have access to the whole set of features and steps definitions.
          if ($testsrunner === true) {
              $configfilepath = behat_command::get_behat_dir($run) . '/behat.yml';
          } else {
              // Alternative for steps definitions filtering, one for each user.
              $configfilepath = self::get_steps_list_config_filepath();
          }
  
          $behatconfigutil = self::get_behat_config_util();
          $behatconfigutil->set_theme_suite_to_include_core_features($themesuitewithallfeatures);
          $behatconfigutil->set_tag_for_feature_filter($tags);
  
          // Gets all the components with features, if running the tests otherwise not required.
          $features = array();
          if ($testsrunner) {
              $features = $behatconfigutil->get_components_features();
          }
  
          // Gets all the components with steps definitions.
          $stepsdefinitions = $behatconfigutil->get_components_contexts($component);
          // We don't want the deprecated steps definitions here.
          if (!$testsrunner) {
              unset($stepsdefinitions['behat_deprecated']);
          }
  
          // Get current run.
          if (empty($run) && ($run !== false) && !empty($CFG->behatrunprocess)) {
              $run = $CFG->behatrunprocess;
          }
  
          // Get number of parallel runs if not passed.
          if (empty($parallelruns) && ($parallelruns !== false)) {
              $parallelruns = self::get_behat_run_config_value('parallel');
          }
  
          // Behat config file specifing the main context class,
          // the required Behat extensions and Moodle test wwwroot.
          $contents = $behatconfigutil->get_config_file_contents($features, $stepsdefinitions, $tags, $parallelruns, $run);
  
          // Stores the file.
          if (!file_put_contents($configfilepath, $contents)) {
              behat_error(BEHAT_EXITCODE_PERMISSIONS, 'File ' . $configfilepath . ' can not be created');
          }
  
      }
code: public static function update_config_file($component = '', $testsrunner = true, $tags = '',
          $themesuitewithallfeatures = false, $parallelruns = 0, $run = 0) {
  
          global $CFG;
  
          // Behat must have a separate behat.yml to have access to the whole set of features and steps definitions.
          if ($testsrunner === true) {
              $configfilepath = behat_command::get_behat_dir($run) . '/behat.yml';
          } else {
              // Alternative for steps definitions filtering, one for each user.
              $configfilepath = self::get_steps_list_config_filepath();
          }
  
          $behatconfigutil = self::get_behat_config_util();
          $behatconfigutil->set_theme_suite_to_include_core_features($themesuitewithallfeatures);
          $behatconfigutil->set_tag_for_feature_filter($tags);
  
          // Gets all the components with features, if running the tests otherwise not required.
          $features = array();
          if ($testsrunner) {
              $features = $behatconfigutil->get_components_features();
          }
  
          // Gets all the components with steps definitions.
          $stepsdefinitions = $behatconfigutil->get_components_contexts($component);
          // We don't want the deprecated steps definitions here.
          if (!$testsrunner) {
              unset($stepsdefinitions['behat_deprecated']);
          }
  
          // Get current run.
          if (empty($run) && ($run !== false) && !empty($CFG->behatrunprocess)) {
              $run = $CFG->behatrunprocess;
          }
  
          // Get number of parallel runs if not passed.
          if (empty($parallelruns) && ($parallelruns !== false)) {
              $parallelruns = self::get_behat_run_config_value('parallel');
          }
  
          // Behat config file specifing the main context class,
          // the required Behat extensions and Moodle test wwwroot.
          $contents = $behatconfigutil->get_config_file_contents($features, $stepsdefinitions, $tags, $parallelruns, $run);
  
          // Stores the file.
          if (!file_put_contents($configfilepath, $contents)) {
              behat_error(BEHAT_EXITCODE_PERMISSIONS, 'File ' . $configfilepath . ' can not be created');
          }
  
      }
code_tokens: public static function update_config_file ( $ component = '' , $ testsrunner = true , $ tags = '' , $ themesuitewithallfeatures = false , $ parallelruns = 0 , $ run = 0 ) { global $ CFG ; // Behat must have a separate behat.yml to have access to the whole set of features and steps definitions. if ( $ testsrunner === true ) { $ configfilepath = behat_command :: get_behat_dir ( $ run ) . '/behat.yml' ; } else { // Alternative for steps definitions filtering, one for each user. $ configfilepath = self :: get_steps_list_config_filepath ( ) ; } $ behatconfigutil = self :: get_behat_config_util ( ) ; $ behatconfigutil -> set_theme_suite_to_include_core_features ( $ themesuitewithallfeatures ) ; $ behatconfigutil -> set_tag_for_feature_filter ( $ tags ) ; // Gets all the components with features, if running the tests otherwise not required. $ features = array ( ) ; if ( $ testsrunner ) { $ features = $ behatconfigutil -> get_components_features ( ) ; } // Gets all the components with steps definitions. $ stepsdefinitions = $ behatconfigutil -> get_components_contexts ( $ component ) ; // We don't want the deprecated steps definitions here. if ( ! $ testsrunner ) { unset ( $ stepsdefinitions [ 'behat_deprecated' ] ) ; } // Get current run. if ( empty ( $ run ) && ( $ run !== false ) && ! empty ( $ CFG -> behatrunprocess ) ) { $ run = $ CFG -> behatrunprocess ; } // Get number of parallel runs if not passed. if ( empty ( $ parallelruns ) && ( $ parallelruns !== false ) ) { $ parallelruns = self :: get_behat_run_config_value ( 'parallel' ) ; } // Behat config file specifing the main context class, // the required Behat extensions and Moodle test wwwroot. $ contents = $ behatconfigutil -> get_config_file_contents ( $ features , $ stepsdefinitions , $ tags , $ parallelruns , $ run ) ; // Stores the file. if ( ! file_put_contents ( $ configfilepath , $ contents ) ) { behat_error ( BEHAT_EXITCODE_PERMISSIONS , 'File ' . $ configfilepath . ' can not be created' ) ; } }
docstring: Updates a config file
  
  The tests runner and the steps definitions list uses different
  config files to avoid problems with concurrent executions.
  
  The steps definitions list can be filtered by component so it's
  behat.yml is different from the $CFG->dirroot one.
  
  @param  string $component Restricts the obtained steps definitions to the specified component
  @param  string $testsrunner If the config file will be used to run tests
  @param  string $tags features files including tags.
  @param  bool   $themesuitewithallfeatures if only theme specific features need to be included in the suite.
  @param  int    $parallelruns number of parallel runs.
  @param  int    $run current run for which config needs to be updated.
  @return void
docstring_tokens: Updates a config file