Skip to content

Commit

Permalink
MDL-76293 gradebook: Address coding violations
Browse files Browse the repository at this point in the history
This includes a data provider which had the 'test_' prefix and was
therefore run as a test.
  • Loading branch information
andrewnicols committed Dec 13, 2022
1 parent 3c12e41 commit 983fadf
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions grade/tests/output/general_action_bar_test.php
Expand Up @@ -49,39 +49,40 @@ protected function find_option_by_name(array $options, string $name): ?array {
/**
* Test the exported data for the general action bar for different user roles and settings.
*
* @dataProvider test_export_for_template_provider
* @dataProvider export_for_template_provider
* @param string $userrole The user role to test
* @param bool $enableoutcomes Whether to enable outcomes
* @param array $expectedoptions The expected options returned in the general action selector
* @covers \core_grades\output\general_action_bar::export_for_template
*/
public function test_export_for_template(string $userrole, bool $enableoutcomes, array $expectedoptions) {
public function test_export_for_template(string $userrole, bool $enableoutcomes, array $expectedoptions): void {
global $PAGE;

// There may be additional plugins installed in the codebase where this
// test is being run, therefore, we need to know which links can be
// present in a standard Moodle install, and only check them.
$allcorenavlinks = [
'View' => [
'Grader report',
'Grade history',
'Grade summary',
'Outcomes report',
'Overview report',
'Single view',
'User report',
],
'Setup' => [
'Gradebook setup',
'Course grade settings',
'Preferences: Grader report',
],
'More' => [
'Scales',
'Outcomes',
'Grade letters',
'Import',
'Export',
]
'View' => [
'Grader report',
'Grade history',
'Grade summary',
'Outcomes report',
'Overview report',
'Single view',
'User report',
],
'Setup' => [
'Gradebook setup',
'Course grade settings',
'Preferences: Grader report',
],
'More' => [
'Scales',
'Outcomes',
'Grade letters',
'Import',
'Export',
],
];

$this->resetAfterTest();
Expand Down Expand Up @@ -146,7 +147,7 @@ public function test_export_for_template(string $userrole, bool $enableoutcomes,
*
* @return array
*/
public function test_export_for_template_provider() : array {
public function export_for_template_provider(): array {
return [
'Gradebook general navigation for admin; outcomes disabled.' => [
'admin',
Expand Down

0 comments on commit 983fadf

Please sign in to comment.