Skip to content

Commit

Permalink
MDL-39441 behat: New setting to expand the list of allowed settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonllao committed Jul 18, 2013
1 parent f38e22e commit 401f60d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config-dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,11 @@
// Example:
// $CFG->behat_restart_browser_after = 7200; // Restarts the browser session after 2 hours
//
// All this page's extra Moodle settings are compared against a white list of allowed settings
// (the basic and behat_* ones) to avoid problems with production environments. This setting can be
// used to expand the default white list with an array of extra settings.
// Example:
// $CFG->behat_extraallowedsettings = array('logsql', 'dblogerror');

//=========================================================================
// ALL DONE! To continue installation, visit your main page with a browser
Expand Down
5 changes: 5 additions & 0 deletions lib/behat/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ function behat_clean_init_config() {
'theme'
));

// Add extra allowed settings.
if (!empty($CFG->behat_extraallowedsettings)) {
$allowed = array_merge($allowed, array_flip($CFG->behat_extraallowedsettings));
}

// Also allowing behat_ prefixed attributes.
foreach ($CFG as $key => $value) {
if (!isset($allowed[$key]) && strpos($key, 'behat_') !== 0) {
Expand Down

0 comments on commit 401f60d

Please sign in to comment.