'; echo "Initialising test database:\n\n"; chdir($CFG->dirroot); ignore_user_abort(true); passthru("php $CFG->admin/tool/phpunit/cli/util.php --buildconfig", $code); passthru("php $CFG->admin/tool/phpunit/cli/util.php --install", $code); chdir($oldcwd); echo '
'; echo "Reinitialising test database:\n\n"; chdir($CFG->dirroot); ignore_user_abort(true); passthru("php $CFG->admin/tool/phpunit/cli/util.php --drop", $code); passthru("php $CFG->admin/tool/phpunit/cli/util.php --buildconfig", $code); passthru("php $CFG->admin/tool/phpunit/cli/util.php --install", $code); chdir($oldcwd); echo '
'; echo "Error: $code\n\n"; echo implode("\n", $output); echo '
'; // use the dataroot file $configdir = "$CFG->phpunit_dataroot/phpunit/webrunner.xml"; if (!file_exists($configdir)) { passthru("php $CFG->admin/tool/phpunit/cli/util.php --buildconfig", $code); if ($code != 0) { tool_phpunit_problem('Can not create configuration file'); } } chdir($CFG->dirroot); $configdir = escapeshellarg($configdir); $cleanclass = escapeshellarg($testclass); $cleanpath = escapeshellarg($testpath); passthru("php $CFG->admin/tool/phpunit/cli/util.php --run -c $configdir $cleanclass $cleanpath", $code); chdir($oldcwd); echo '