Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Utils to set Behat config

Copyright: 2012 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 361 lines (13 kb)
Included or required: 3 times
Referenced: 0 times
Includes or requires: 1 file
 lib/behat/classes/behat_config_util.php

Defines 1 class


Class: behat_config_manager  - X-Ref

Behat configuration manager

Creates/updates Behat config files getting tests
and steps from Moodle codebase

get_behat_config_util()   X-Ref
Returns behat_config_util.

return: behat_config_util

update_config_file($component = '', $testsrunner = true, $tags = '',$themesuitewithallfeatures = false, $parallelruns = 0, $run = 0)   X-Ref
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

get_features_with_tags()   X-Ref


get_components_steps_definitions()   X-Ref


get_steps_list_config_filepath()   X-Ref
Returns the behat config file path used by the steps definition list

return: string

get_behat_cli_config_filepath($runprocess = 0)   X-Ref
Returns the behat config file path used by the behat cli command.

param: int $runprocess Runprocess.
return: string

get_behat_run_config_file_path()   X-Ref
Returns the path to the parallel run file which specifies if parallel test environment is enabled
and how many parallel runs to execute.

return: string

get_behat_run_config_value($key)   X-Ref
Get config for parallel run.

param: string $key Key to store
return: string|int|array value which is stored.

set_behat_run_config_value($key, $value)   X-Ref
Save/update config for parallel run.

param: string $key Key to store
param: string|int|array $value to store.

drop_parallel_site_links()   X-Ref
Drops parallel site links.

return: bool true on success else false.

create_parallel_site_links($fromrun, $torun)   X-Ref
Create parallel site links.

param: int $fromrun first run
param: int $torun last run.
return: bool true for sucess, else false.

get_config_file_contents()   X-Ref


merge_behat_config()   X-Ref


get_behat_profile()   X-Ref


profile_guided_allocate()   X-Ref


merge_config()   X-Ref


clean_path()   X-Ref


get_behat_tests_path()   X-Ref