From 6bcc5dfdb4b3f8fe5b7ab10cb54320a607304f65 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Wed, 3 Apr 2019 10:44:24 +0800 Subject: [PATCH] MDL-65204 phpunit: Fix valid CiBoT errors and warnings --- .../classes/constraint_object_is_equal_with_exceptions.php | 3 ++- lib/tests/completionlib_test.php | 3 ++- mod/quiz/tests/attempt_walkthrough_from_csv_test.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/phpunit/classes/constraint_object_is_equal_with_exceptions.php b/lib/phpunit/classes/constraint_object_is_equal_with_exceptions.php index 44dda06ce92..5fa1d25d4eb 100644 --- a/lib/phpunit/classes/constraint_object_is_equal_with_exceptions.php +++ b/lib/phpunit/classes/constraint_object_is_equal_with_exceptions.php @@ -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; } diff --git a/lib/tests/completionlib_test.php b/lib/tests/completionlib_test.php index 1b4f163a949..208aeb1d751 100644 --- a/lib/tests/completionlib_test.php +++ b/lib/tests/completionlib_test.php @@ -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')) { diff --git a/mod/quiz/tests/attempt_walkthrough_from_csv_test.php b/mod/quiz/tests/attempt_walkthrough_from_csv_test.php index 029dbd2ffb1..0ec00deb8cd 100644 --- a/mod/quiz/tests/attempt_walkthrough_from_csv_test.php +++ b/mod/quiz/tests/attempt_walkthrough_from_csv_test.php @@ -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.