/**
  * Gives access to moodle codebase, ensures all is ready and sets up the test lock.
  *
  * Includes config.php to use moodle codebase with $CFG->behat_*
  * instead of $CFG->prefix and $CFG->dataroot, called once per suite.
  *
  * @param SuiteEvent $event event before suite.
  * @static
  * @throws Exception
  * @BeforeSuite
  */
 public static function before_suite(SuiteEvent $event)
 {
     global $CFG;
     define('CLI_SCRIPT', 1);
     $moodlepath = util::get_moodle_path();
     require_once $moodlepath . '/config.php';
     require_once __DIR__ . '/inc.php';
     // Now that we are MOODLE_INTERNAL.
     require_once $CFG->libdir . '/behat/classes/behat_command.php';
     require_once $CFG->libdir . '/behat/classes/behat_selectors.php';
     require_once $CFG->libdir . '/behat/classes/behat_context_helper.php';
     require_once $CFG->libdir . '/behat/classes/util.php';
     require_once $CFG->libdir . '/testing/classes/test_lock.php';
     require_once $CFG->libdir . '/testing/classes/nasty_strings.php';
     // Initialise BrowserMobProxy.
     $browsermobproxy = new browsermobproxyclient(util::get_option('proxyurl'));
     // Use the proxy server url now.
     $browsermobproxy->create_connection(util::get_option('proxyport'));
     util::drop_dir(util::get_final_testplan_path());
     // Update global properties in test plan.
     testplan_writer::start_testplan(util::get_option('size'));
 }