Exemplo n.º 1
0
$CFG->debugdisplay = 1;
error_reporting($CFG->debug);
ini_set('display_errors', '1');
ini_set('log_errors', '1');
$CFG->noemailever = true;
// better not mail anybody from tests, override temporarily if necessary
$CFG->cachetext = 0;
// disable this very nasty setting
// some ugly hacks
$CFG->themerev = 1;
$CFG->jsrev = 1;
// load test case stub classes and other stuff
require_once "{$CFG->dirroot}/lib/phpunit/lib.php";
// finish moodle init
define('ABORT_AFTER_CONFIG_CANCEL', true);
require "{$CFG->dirroot}/lib/setup.php";
raise_memory_limit(MEMORY_HUGE);
if (PHPUNIT_UTIL) {
    // we are not going to do testing, this is 'true' in utility scripts that only init database
    return;
}
// is database and dataroot ready for testing?
list($errorcode, $message) = phpunit_util::testing_ready_problem();
// print some version info
phpunit_util::bootstrap_moodle_info();
if ($errorcode) {
    phpunit_bootstrap_error($errorcode, $message);
}
// prepare for the first test run - store fresh globals, reset database and dataroot, etc.
phpunit_util::bootstrap_init();