Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 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: 365 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.

return: void
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.

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.

return: string
param: int $runprocess Runprocess.

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.

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

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.

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

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