mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-72527 core: Fix behat unit test failure
$CFG->behat_wwwroot, $CFG->behat_dataroot and $CFG->behat_prefix being undefined resulted in unit test failure.
This commit is contained in:
parent
1d700796ca
commit
728e8c4a3c
@ -184,7 +184,7 @@ $allowed = array('wwwroot', 'dataroot', 'dirroot', 'admin', 'directorypermission
|
||||
$productioncfg = (array)$CFG;
|
||||
$CFG = new stdClass();
|
||||
foreach ($productioncfg as $key=>$value) {
|
||||
if (!in_array($key, $allowed) and strpos($key, 'phpunit_') !== 0) {
|
||||
if (!in_array($key, $allowed) and strpos($key, 'phpunit_') !== 0 and strpos($key, 'behat_') !== 0) {
|
||||
// ignore
|
||||
continue;
|
||||
}
|
||||
|
@ -32,6 +32,22 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class behat_lib_test extends advanced_testcase {
|
||||
|
||||
/**
|
||||
* Setup function
|
||||
*
|
||||
* Skip these tests if behat is not configured.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp(): void {
|
||||
global $CFG;
|
||||
|
||||
if (empty($CFG->behat_wwwroot) || empty($CFG->behat_dataroot) || empty($CFG->behat_prefix)) {
|
||||
$this->markTestSkipped('Behat not configured');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for behat_is_requested_url() function.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user