MDL-71439 core_grade: Coding style tidyup

This commit is contained in:
Andrew Nicols 2021-11-05 09:56:36 +08:00
parent 69ec4376c7
commit 924d538235
3 changed files with 18 additions and 4 deletions

View File

@ -156,7 +156,8 @@ class fetch extends external_api {
* @param bool $isgrading
* @return array
*/
public static function get_fetch_data(stdClass $grade,
public static function get_fetch_data(
stdClass $grade,
bool $hasgrade,
gradeitem $gradeitem,
?string $gradername,

View File

@ -25,4 +25,4 @@
{
}
}}
}}

View File

@ -29,8 +29,6 @@ use advanced_testcase;
use mod_forum\local\container;
use mod_forum\local\entities\forum as forum_entity;
defined('MOODLE_INTERNAL') || die();
/**
* Unit tests for the class component_gradeitem.
*
@ -38,11 +36,14 @@ defined('MOODLE_INTERNAL') || die();
* @category test
* @copyright 2021 Mark Nelson <marknelson@catalyst-au.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @coversDefaultClass \core_grades\component_gradeitem
*/
class component_gradeitem_test extends advanced_testcase {
/**
* Test get_formatted_grade_for_user with points.
*
* @covers ::get_formatted_grade_for_user
*/
public function test_get_formatted_grade_for_user_with_points() {
$grade = $this->initialise_test_and_get_grade_item(5, 4);
@ -54,6 +55,8 @@ class component_gradeitem_test extends advanced_testcase {
/**
* Test get_formatted_grade_for_user with letters.
*
* @covers ::get_formatted_grade_for_user
*/
public function test_get_formatted_grade_for_user_with_letters() {
$grade = $this->initialise_test_and_get_grade_item(5, 4, GRADE_DISPLAY_TYPE_LETTER);
@ -65,6 +68,8 @@ class component_gradeitem_test extends advanced_testcase {
/**
* Test get_formatted_grade_for_user with percentage.
*
* @covers ::get_formatted_grade_for_user
*/
public function test_get_formatted_grade_for_user_with_percentage() {
$grade = $this->initialise_test_and_get_grade_item(5, 4, GRADE_DISPLAY_TYPE_PERCENTAGE);
@ -76,6 +81,8 @@ class component_gradeitem_test extends advanced_testcase {
/**
* Test get_formatted_grade_for_user with points and letter.
*
* @covers ::get_formatted_grade_for_user
*/
public function test_get_formatted_grade_for_user_with_points_letter() {
$grade = $this->initialise_test_and_get_grade_item(5, 4, GRADE_DISPLAY_TYPE_REAL_LETTER);
@ -87,6 +94,8 @@ class component_gradeitem_test extends advanced_testcase {
/**
* Test get_formatted_grade_for_user with scales.
*
* @covers ::get_formatted_grade_for_user
*/
public function test_get_formatted_grade_for_user_with_scales() {
$grade = $this->initialise_test_and_get_grade_item(-2, 2);
@ -98,6 +107,8 @@ class component_gradeitem_test extends advanced_testcase {
/**
* Test get_formatted_grade_for_user with rubric.
*
* @covers ::get_formatted_grade_for_user
*/
public function test_get_formatted_grade_for_user_with_rubric() {
$this->resetAfterTest();
@ -149,6 +160,8 @@ class component_gradeitem_test extends advanced_testcase {
/**
* Test get_formatted_grade_for_user with a marking guide.
*
* @covers ::get_formatted_grade_for_user
*/
public function test_get_formatted_grade_for_user_with_marking_guide() {
$this->resetAfterTest();