diff --git a/admin/tool/behat/tests/tool_behat_test.php b/admin/tool/behat/tests/tool_behat_test.php index c8fa4883048..09db5e659c7 100644 --- a/admin/tool/behat/tests/tool_behat_test.php +++ b/admin/tool/behat/tests/tool_behat_test.php @@ -150,6 +150,11 @@ class tool_behat_testcase extends advanced_testcase { $this->markTestSkipped('Behat not installed.'); } + // It is possible that it has no value. + if (empty($CFG->behat_wwwroot)) { + $CFG->behat_wwwroot = behat_get_wwwroot(); + } + // To avoid user value at config.php level. unset($CFG->behat_config); @@ -183,6 +188,8 @@ class tool_behat_testcase extends advanced_testcase { // Lists. $this->assertContains('- feature1', $contents); $this->assertContains('- feature3', $contents); + + unset($CFG->behat_wwwroot); } }