From f40184265a6a916941d3e92b4b864fa89b826c99 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 26 Jun 2009 15:51:12 +0000 Subject: [PATCH] MDL-19579 code coverage - add lang strings and open complete report in new window --- lang/en_utf8/simpletest.php | 6 ++++++ lib/simpletestcoveragelib.php | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lang/en_utf8/simpletest.php b/lang/en_utf8/simpletest.php index 7cd7f42ee84..5517212a7f6 100644 --- a/lang/en_utf8/simpletest.php +++ b/lang/en_utf8/simpletest.php @@ -5,13 +5,17 @@ $string['all'] = 'ALL'; $string['addconfigprefix'] = 'Add prefix to config file'; $string['codecoverageanalysis'] = 'Perform code coverage analysis.'; +$string['codecoveragecompletereport'] = 'view code coverage complete report'; $string['codecoveragedisabled'] = 'Cannot enable code coverage in this server (missing xdebug extension).'; $string['confignonwritable'] = 'The file config.php is not writeable by the web server. Either change its permissions, or edit it with the appropriate user account, and add the following line before the closing php tag:
\$CFG->unittestprefix = \'tst_\' // Change tst_ to a prefix of your choice, different from \$CFG->prefix'; +$string['coveredlines'] = 'Covered lines'; +$string['coveredpercentage'] = 'Overall Code Coverage'; $string['deletingnoninsertedrecord'] = 'Trying to delete a record that was not inserted by these unit tests (id $a->id in table $a->table).'; $string['deletingnoninsertedrecords'] = 'Trying to delete records that were not inserted by these unit tests (from table $a->table).'; $string['droptesttables'] = 'Drop test tables'; $string['exception'] = 'Exception'; +$string['executablelines'] = 'Executable lines'; $string['fail'] = 'Fail'; $string['ignorefile'] = 'Ignore tests in the file'; $string['ignorethisfile'] = 'Re-run the tests ignoring this test file.'; @@ -42,9 +46,11 @@ $string['testtablesneedupgrade'] = 'The test DB tables need to be upgraded. Do y $string['testtablesok'] = 'The test DB tables were successfully installed.'; $string['testtablescsvfileunwritable'] = 'The test tables CSV file is not writable ($a->filename)'; $string['timetakes'] = 'Time taken: $a.'; +$string['totallines'] = 'Total lines'; $string['thorough'] = 'Run a thorough test (may be slow).'; $string['updatingnoninsertedrecord'] = 'Trying to update a record that was not inserted by these unit tests (id $a->id in table $a->table).'; $string['uncaughtexception'] = 'Uncaught exception [{$a->getMessage()}] in [{$a->getFile()}:{$a->getLine()}] TESTS ABORTED.'; +$string['uncoveredlines'] = 'Uncovered lines'; $string['unittests'] = 'Unit tests'; $string['unittestprefixsetting'] = 'Unit test prefix: $CFG->unittestprefix (Edit config.php to modify this).'; $string['version'] = 'Using SimpleTest version $a.'; diff --git a/lib/simpletestcoveragelib.php b/lib/simpletestcoveragelib.php index b6ccdaff20e..54172dd17c5 100644 --- a/lib/simpletestcoveragelib.php +++ b/lib/simpletestcoveragelib.php @@ -29,7 +29,6 @@ */ /// TODO: provide one helper function to show links from test page to coverage report -/// TODO: add missing lang strings /** * Includes @@ -449,9 +448,10 @@ class moodle_coverage_reporter extends HtmlCoverageReporter { array(get_string('coveredpercentage', 'simpletest'), format_float($data->totalpercentage, 2) . '%') ); - $result .= $OUTPUT->heading($data->title, 3, 'main codecoverageheading', true); - $result .= $OUTPUT->heading('(' . get_string('codecoveragecompletereport', 'simpletest') . ')', 4, 'main codecoveragelink', true); + $url = $CFG->wwwroot . '/admin/report/unittest/coveragefile.php/' . $type . '/index.html'; + $result .= $OUTPUT->heading($data->title, 3, 'main codecoverageheading'); + $result .= $OUTPUT->heading('(' . get_string('codecoveragecompletereport', 'simpletest') . ')', 4, 'main codecoveragelink'); $result .= print_table($table, true); return $OUTPUT->box($result, 'generalbox boxwidthwide boxaligncenter codecoveragebox', '', true);