From: Rajesh Taneja Date: Thu, 20 Nov 2014 07:42:32 +0000 (+0800) Subject: MDL-48302 behat: Reset all data, before starting behat suite X-Git-Tag: v2.9.0-beta~956^2~1 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=ab25d8a7f7f96f59f28643f2d2e98b4943027376 MDL-48302 behat: Reset all data, before starting behat suite --- diff --git a/lib/tests/behat/behat_hooks.php b/lib/tests/behat/behat_hooks.php index 4c160dd7999..81b1182b966 100644 --- a/lib/tests/behat/behat_hooks.php +++ b/lib/tests/behat/behat_hooks.php @@ -123,6 +123,10 @@ class behat_hooks extends behat_base { throw new Exception('Behat only can run if test mode is enabled. More info in ' . behat_command::DOCS_URL . '#Running_tests'); } + // Reset all data, before checking for is_server_running. + // If not done, then it can return apache error, while running tests. + behat_util::reset_all_data(); + if (!behat_util::is_server_running()) { throw new Exception($CFG->behat_wwwroot . ' is not available, ensure you specified correct url and that the server is set up and started.' .