MDL-63730 quiz: Fix unit tests to use the new way of percents display

As agreed in MDL-63186, the English language pack has no space
separating the number and the percents. This patch removes the
regressions from the unit tests.
This commit is contained in:
David Mudrák
2018-10-26 14:26:12 +02:00
parent f5d98e6173
commit 8743cade5b
2 changed files with 7 additions and 7 deletions
@@ -45,12 +45,12 @@ class quiz_statistics_statistics_table_testcase extends advanced_testcase {
$method->setAccessible(true);
$this->assertEquals(
'84.758 %',
'84.758%',
$method->invokeArgs($table, [0.847576, true, 3])
);
$this->assertEquals(
'84.758 %',
'84.758%',
$method->invokeArgs($table, [84.7576, false, 3])
);
}
@@ -64,12 +64,12 @@ class quiz_statistics_statistics_table_testcase extends advanced_testcase {
$method->setAccessible(true);
$this->assertEquals(
'54.400 % 84.758 %',
'54.400% 84.758%',
$method->invokeArgs($table, [0.544, 0.847576, true, 3])
);
$this->assertEquals(
'54.400 % 84.758 %',
'54.400% 84.758%',
$method->invokeArgs($table, [54.4, 84.7576, false, 3])
);
}
+3 -3
View File
@@ -27,9 +27,9 @@
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/mod/quiz/attemptlib.php');
require_once($CFG->dirroot . '/mod/quiz/report/reportlib.php');
/**
* This class contains the test cases for the functions in reportlib.php.
*
@@ -66,9 +66,9 @@ class mod_quiz_reportlib_testcase extends advanced_testcase {
$quiz->sumgrades = 10;
$quiz->decimalpoints = 2;
$this->assertEquals('12.34567 %',
$this->assertEquals('12.34567%',
quiz_report_scale_summarks_as_percentage(1.234567, $quiz, false));
$this->assertEquals('12.35 %',
$this->assertEquals('12.35%',
quiz_report_scale_summarks_as_percentage(1.234567, $quiz, true));
$this->assertEquals('-',
quiz_report_scale_summarks_as_percentage('-', $quiz, true));