throw new coding_exception('This method can be only used by Behat CLI tool');
}
+ $tables = $DB->get_tables(false);
+ if (!empty($tables)) {
+ behat_error(BEHAT_EXITCODE_INSTALLED);
+ }
+
// New dataroot.
self::reset_dataroot();
define('BEHAT_EXITCODE_REINSTALL', 253);
define('BEHAT_EXITCODE_INSTALL', 254);
define('BEHAT_EXITCODE_COMPOSER', 255);
+define('BEHAT_EXITCODE_INSTALLED', 256);
/**
* Exits with an error code
$path = testing_cli_argument_path('/admin/tool/behat/cli/init.php');
$text = "Install Behat before enabling it, use:\n php ".$path;
break;
+ case BEHAT_EXITCODE_INSTALLED:
+ $text = "The Behat site is already installed";
+ break;
default:
$text = 'Unknown error ' . $errorcode . ' ' . $text;
break;