MDL-65204 phpunit: Fix valid CiBoT errors and warnings

This commit is contained in:
Jun Pataleta 2019-04-03 10:44:24 +08:00
parent 032c75ec43
commit 6bcc5dfdb4
3 changed files with 6 additions and 3 deletions

View File

@ -47,7 +47,8 @@ class phpunit_constraint_object_is_equal_with_exceptions extends PHPUnit\Framewo
/**
* Override constructor to capture value
*/
public function __construct($value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) {
public function __construct($value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false,
bool $ignoreCase = false) {
parent::__construct($value, $delta, $maxDepth, $canonicalize, $ignoreCase);
$this->capturedvalue = $value;
}

View File

@ -76,7 +76,8 @@ class core_completionlib_testcase extends advanced_testcase {
* @param boolean $canonicalize
* @param boolean $ignoreCase
*/
public static function assertEquals($expected, $actual, string $message = '', float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void {
public static function assertEquals($expected, $actual, string $message = '', float $delta = 0, int $maxDepth = 10,
bool $canonicalize = false, bool $ignoreCase = false): void {
// Nasty cheating hack: prevent random failures on timemodified field.
if (is_object($expected) and is_object($actual)) {
if (property_exists($expected, 'timemodified') and property_exists($actual, 'timemodified')) {

View File

@ -338,7 +338,8 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase {
$this->assertEquals((bool)$value, $attemptobj->is_finished());
break;
case 'summarks' :
$this->assertEquals((float)$value, $attemptobj->get_sum_marks(), "Sum of marks of attempt {$result['quizattempt']}.");
$this->assertEquals((float)$value, $attemptobj->get_sum_marks(),
"Sum of marks of attempt {$result['quizattempt']}.");
break;
case 'quizgrade' :
// Check quiz grades.