unset($UNITTEST->func_test_db); echo '<hr />'; } if ($codecoverage) { $covrecorder->generate_report(); moodle_coverage_reporter::print_summary_info('dbtest'); } } // Print the form for adjusting options. echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter'); echo '<form method="post" action="dbtest.php">'; echo '<div>'; echo $OUTPUT->heading("Run functional database tests"); // TODO: localise echo '<p>' . html_writer::checkbox('showpasses', 1, $showpasses, get_string('showpasses', 'tool_unittest')) . '</p>'; if (moodle_coverage_recorder::can_run_codecoverage()) { echo '<p>' . html_writer::checkbox('codecoverage', 1, $codecoverage, get_string('codecoverageanalysis', 'tool_unittest')) . '</p>'; } else { echo '<p>'; print_string('codecoveragedisabled', 'tool_unittest'); echo '<input type="hidden" name="codecoverage" value="0" /></p>'; } echo '<p><strong>' . "Databases:" . '</strong></p>'; echo '<ul>'; foreach ($dbinfos as $i => $dbinfo) { $name = $dbinfo['name']; if ($dbinfo['installed']) { if (!$dbinfo['configured']) { $name = "{$name} (misconfigured)"; // TODO: localise }
/** * Run the autogroup_test_coverage tests using one externally defined code coverage reporter * allowing further process of coverage data once tests are over. Supports multiple * instrumentations (code coverage gathering sessions) to be executed. */ public function run_with_external_coverage($simpletestreporter, $covrecorder) { if (moodle_coverage_recorder::can_run_codecoverage() && $this->performcoverage) { $covrecorder->setIncludePaths($this->includecoverage); $covrecorder->setExcludePaths($this->excludecoverage); $covrecorder->start_instrumentation(); parent::run($simpletestreporter); $covrecorder->stop_instrumentation(); } else { // Testing without coverage parent::run($simpletestreporter); } }