MDL-81522 phpunit: Add missing void return type to all tests

While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.

All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
This commit is contained in:
Eloy Lafuente (stronk7)
2024-06-11 12:18:04 +02:00
parent db07c09afc
commit 1093256560
1360 changed files with 9928 additions and 9928 deletions
+78 -78
View File
@@ -25,7 +25,7 @@ namespace core_competency;
*/
class api_test extends \advanced_testcase {
public function test_get_framework_related_contexts() {
public function test_get_framework_related_contexts(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$cat1 = $dg->create_category();
@@ -48,7 +48,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($expected, api::get_related_contexts($cat2ctx, 'parents'));
}
public function test_get_framework_related_contexts_with_capabilities() {
public function test_get_framework_related_contexts_with_capabilities(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$user = $dg->create_user();
@@ -86,7 +86,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($expected, api::get_related_contexts($cat2ctx, 'parents', $requiredcap));
}
public function test_get_template_related_contexts() {
public function test_get_template_related_contexts(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$cat1 = $dg->create_category();
@@ -109,7 +109,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($expected, api::get_related_contexts($cat2ctx, 'parents'));
}
public function test_get_template_related_contexts_with_capabilities() {
public function test_get_template_related_contexts_with_capabilities(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$user = $dg->create_user();
@@ -150,7 +150,7 @@ class api_test extends \advanced_testcase {
/**
* Test updating a template.
*/
public function test_update_template() {
public function test_update_template(): void {
$cat = $this->getDataGenerator()->create_category();
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -174,7 +174,7 @@ class api_test extends \advanced_testcase {
/**
* Test listing framework with order param.
*/
public function test_list_frameworks() {
public function test_list_frameworks(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
@@ -263,7 +263,7 @@ class api_test extends \advanced_testcase {
/**
* Test duplicate a framework.
*/
public function test_duplicate_framework() {
public function test_duplicate_framework(): void {
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -372,7 +372,7 @@ class api_test extends \advanced_testcase {
/**
* Test update plan.
*/
public function test_update_plan() {
public function test_update_plan(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$usermanageowndraft = $dg->create_user();
@@ -494,7 +494,7 @@ class api_test extends \advanced_testcase {
}
}
public function test_create_plan_from_template() {
public function test_create_plan_from_template(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -520,7 +520,7 @@ class api_test extends \advanced_testcase {
$plan = api::create_plan($record);
}
public function test_update_plan_based_on_template() {
public function test_update_plan_based_on_template(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -564,7 +564,7 @@ class api_test extends \advanced_testcase {
}
}
public function test_unlink_plan_from_template() {
public function test_unlink_plan_from_template(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -645,7 +645,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($before->get('sortorder'), $after->get('sortorder'));
}
public function test_update_template_updates_plans() {
public function test_update_template_updates_plans(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -738,7 +738,7 @@ class api_test extends \advanced_testcase {
/**
* Test that the method to complete a plan.
*/
public function test_complete_plan() {
public function test_complete_plan(): void {
global $DB;
$this->resetAfterTest(true);
@@ -865,7 +865,7 @@ class api_test extends \advanced_testcase {
/**
* Testing requesting the review of a plan.
*/
public function test_plan_request_review() {
public function test_plan_request_review(): void {
$data = $this->setup_workflow_data();
$dg = $data['dg'];
$lpg = $data['lpg'];
@@ -963,7 +963,7 @@ class api_test extends \advanced_testcase {
/**
* Testing cancelling the review request.
*/
public function test_plan_cancel_review_request() {
public function test_plan_cancel_review_request(): void {
$data = $this->setup_workflow_data();
$dg = $data['dg'];
$lpg = $data['lpg'];
@@ -1064,7 +1064,7 @@ class api_test extends \advanced_testcase {
/**
* Testing starting the review.
*/
public function test_plan_start_review() {
public function test_plan_start_review(): void {
$data = $this->setup_workflow_data();
$dg = $data['dg'];
$lpg = $data['lpg'];
@@ -1168,7 +1168,7 @@ class api_test extends \advanced_testcase {
/**
* Testing stopping the review.
*/
public function test_plan_stop_review() {
public function test_plan_stop_review(): void {
$data = $this->setup_workflow_data();
$dg = $data['dg'];
$lpg = $data['lpg'];
@@ -1269,7 +1269,7 @@ class api_test extends \advanced_testcase {
/**
* Testing approving the plan.
*/
public function test_approve_plan() {
public function test_approve_plan(): void {
$data = $this->setup_workflow_data();
$dg = $data['dg'];
$lpg = $data['lpg'];
@@ -1364,7 +1364,7 @@ class api_test extends \advanced_testcase {
/**
* Testing stopping the review.
*/
public function test_unapprove_plan() {
public function test_unapprove_plan(): void {
$data = $this->setup_workflow_data();
$dg = $data['dg'];
$lpg = $data['lpg'];
@@ -1465,7 +1465,7 @@ class api_test extends \advanced_testcase {
/**
* Test update plan and the managing of archived user competencies.
*/
public function test_update_plan_manage_archived_competencies() {
public function test_update_plan_manage_archived_competencies(): void {
global $DB;
$this->resetAfterTest(true);
@@ -1573,7 +1573,7 @@ class api_test extends \advanced_testcase {
/**
* Test completing plan does not change the order of competencies.
*/
public function test_complete_plan_doesnot_change_order() {
public function test_complete_plan_doesnot_change_order(): void {
global $DB;
$this->resetAfterTest(true);
@@ -1663,7 +1663,7 @@ class api_test extends \advanced_testcase {
/**
* Test remove plan and the managing of archived user competencies.
*/
public function test_delete_plan_manage_archived_competencies() {
public function test_delete_plan_manage_archived_competencies(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
@@ -1712,7 +1712,7 @@ class api_test extends \advanced_testcase {
/**
* Test listing of plan competencies.
*/
public function test_list_plan_competencies_manage_archived_competencies() {
public function test_list_plan_competencies_manage_archived_competencies(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
@@ -1791,7 +1791,7 @@ class api_test extends \advanced_testcase {
$this->assertNull($plancompetencies[2]->usercompetency);
}
public function test_create_template_cohort() {
public function test_create_template_cohort(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -1819,7 +1819,7 @@ class api_test extends \advanced_testcase {
array('id' => $t2->get('id'))));
}
public function test_create_template_cohort_permissions() {
public function test_create_template_cohort_permissions(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
@@ -1863,7 +1863,7 @@ class api_test extends \advanced_testcase {
$this->assertInstanceOf('core_competency\\template_cohort', $result);
}
public function test_reorder_template_competencies_permissions() {
public function test_reorder_template_competencies_permissions(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
@@ -1928,7 +1928,7 @@ class api_test extends \advanced_testcase {
}
}
public function test_delete_template() {
public function test_delete_template(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -1958,7 +1958,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(0, \core_competency\template_cohort::count_records(array('templateid' => $id)));
}
public function test_delete_template_cohort() {
public function test_delete_template_cohort(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -1997,7 +1997,7 @@ class api_test extends \advanced_testcase {
array('id' => $t2->get('id'))));
}
public function test_add_evidence_log() {
public function test_add_evidence_log(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -2062,7 +2062,7 @@ class api_test extends \advanced_testcase {
}
}
public function test_add_evidence_complete() {
public function test_add_evidence_complete(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -2158,7 +2158,7 @@ class api_test extends \advanced_testcase {
}
}
public function test_add_evidence_override() {
public function test_add_evidence_override(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -2233,7 +2233,7 @@ class api_test extends \advanced_testcase {
$this->assertSame(null, $evidence->get('grade'));
}
public function test_add_evidence_and_send_for_review() {
public function test_add_evidence_and_send_for_review(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -2267,7 +2267,7 @@ class api_test extends \advanced_testcase {
/**
* Test add evidence for existing user_competency.
*/
public function test_add_evidence_existing_user_competency() {
public function test_add_evidence_existing_user_competency(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
@@ -2309,7 +2309,7 @@ class api_test extends \advanced_testcase {
/**
* Test add evidence for non-existing user_competency.
*/
public function test_add_evidence_no_existing_user_competency() {
public function test_add_evidence_no_existing_user_competency(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
@@ -2346,7 +2346,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(0, $uc->get('proficiency'));
}
public function test_add_evidence_applies_competency_rules() {
public function test_add_evidence_applies_competency_rules(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -2446,7 +2446,7 @@ class api_test extends \advanced_testcase {
* Tests for the user_competency_course data when api::add_evidence() is invoked when
* grading a user competency in the system context.
*/
public function test_add_evidence_for_user_competency_course_grade_outside_course() {
public function test_add_evidence_for_user_competency_course_grade_outside_course(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$syscontext = \context_system::instance();
@@ -2477,7 +2477,7 @@ class api_test extends \advanced_testcase {
* Tests for the user_competency_course data when api::add_evidence() is invoked when
* grading a user competency in a course.
*/
public function test_add_evidence_user_competency_course_grade_in_course() {
public function test_add_evidence_user_competency_course_grade_in_course(): void {
global $USER;
$this->resetAfterTest(true);
@@ -2539,7 +2539,7 @@ class api_test extends \advanced_testcase {
$this->assertNotEquals($usercompcourse->get('proficiency'), $usercompetency->get('proficiency'));
}
public function test_observe_course_completed() {
public function test_observe_course_completed(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -2634,7 +2634,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(null, $ev4->get('actionuserid'));
}
public function test_list_evidence_in_course() {
public function test_list_evidence_in_course(): void {
global $SITE;
$this->resetAfterTest(true);
@@ -2675,7 +2675,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($evidence2->get('id'), $result[1]->get('id'));
}
public function test_list_course_modules_using_competency() {
public function test_list_course_modules_using_competency(): void {
global $SITE;
$this->resetAfterTest(true);
@@ -2754,7 +2754,7 @@ class api_test extends \advanced_testcase {
/**
* Test update ruleoutcome for course_competency.
*/
public function test_set_ruleoutcome_course_competency() {
public function test_set_ruleoutcome_course_competency(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -2784,7 +2784,7 @@ class api_test extends \advanced_testcase {
/**
* Test validation on grade on user_competency.
*/
public function test_validate_grade_in_user_competency() {
public function test_validate_grade_in_user_competency(): void {
global $DB;
$this->resetAfterTest(true);
@@ -2859,7 +2859,7 @@ class api_test extends \advanced_testcase {
/**
* Test when adding competency that belong to hidden framework to plan/template/course.
*/
public function test_hidden_framework() {
public function test_hidden_framework(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
$dg = $this->getDataGenerator();
@@ -2909,7 +2909,7 @@ class api_test extends \advanced_testcase {
/**
* Test when using hidden template in plan/cohort.
*/
public function test_hidden_template() {
public function test_hidden_template(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
$dg = $this->getDataGenerator();
@@ -2937,7 +2937,7 @@ class api_test extends \advanced_testcase {
/**
* Test that completed plan created form a template does not change when template is modified.
*/
public function test_completed_plan_doesnot_change() {
public function test_completed_plan_doesnot_change(): void {
global $DB;
$this->resetAfterTest(true);
@@ -3032,7 +3032,7 @@ class api_test extends \advanced_testcase {
);
}
public function test_moving_competency_reset_rules_updown() {
public function test_moving_competency_reset_rules_updown(): void {
$data = $this->setup_framework_for_reset_rules_tests();
$f1 = $data['f1'];
$c1 = $data['c1'];
@@ -3062,7 +3062,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(competency::OUTCOME_EVIDENCE, $c1a1->get('ruleoutcome'));
}
public function test_moving_competency_reset_rules_parent() {
public function test_moving_competency_reset_rules_parent(): void {
$data = $this->setup_framework_for_reset_rules_tests();
$f1 = $data['f1'];
$c1 = $data['c1'];
@@ -3089,7 +3089,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(competency::OUTCOME_EVIDENCE, $c2->get('ruleoutcome'));
}
public function test_moving_competency_reset_rules_totoplevel() {
public function test_moving_competency_reset_rules_totoplevel(): void {
$data = $this->setup_framework_for_reset_rules_tests();
$f1 = $data['f1'];
$c1 = $data['c1'];
@@ -3116,7 +3116,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(competency::OUTCOME_EVIDENCE, $c2->get('ruleoutcome'));
}
public function test_moving_competency_reset_rules_fromtoplevel() {
public function test_moving_competency_reset_rules_fromtoplevel(): void {
$data = $this->setup_framework_for_reset_rules_tests();
$f1 = $data['f1'];
$c1 = $data['c1'];
@@ -3143,7 +3143,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(competency::OUTCOME_EVIDENCE, $c2->get('ruleoutcome'));
}
public function test_moving_competency_reset_rules_child() {
public function test_moving_competency_reset_rules_child(): void {
$data = $this->setup_framework_for_reset_rules_tests();
$f1 = $data['f1'];
$c1 = $data['c1'];
@@ -3170,7 +3170,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(competency::OUTCOME_EVIDENCE, $c2->get('ruleoutcome'));
}
public function test_create_competency_reset_rules() {
public function test_create_competency_reset_rules(): void {
$data = $this->setup_framework_for_reset_rules_tests();
$f1 = $data['f1'];
$c1 = $data['c1'];
@@ -3198,7 +3198,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(competency::OUTCOME_EVIDENCE, $c2->get('ruleoutcome'));
}
public function test_delete_competency_reset_rules() {
public function test_delete_competency_reset_rules(): void {
$data = $this->setup_framework_for_reset_rules_tests();
$f1 = $data['f1'];
$c1 = $data['c1'];
@@ -3221,7 +3221,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(competency::OUTCOME_EVIDENCE, $c2->get('ruleoutcome'));
}
public function test_template_has_related_data() {
public function test_template_has_related_data(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -3241,7 +3241,7 @@ class api_test extends \advanced_testcase {
}
public function test_delete_template_delete_plans() {
public function test_delete_template_delete_plans(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -3280,7 +3280,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(0, count(\core_competency\plan::get_records(array('templateid' => $tpl->get('id')))));
}
public function test_delete_template_unlink_plans() {
public function test_delete_template_unlink_plans(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
@@ -3322,7 +3322,7 @@ class api_test extends \advanced_testcase {
$this->assertNull($plans[0]->get('templateid'));
}
public function test_delete_competency() {
public function test_delete_competency(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3382,7 +3382,7 @@ class api_test extends \advanced_testcase {
$this->assertFalse(competency::record_exists($c2->get('id')));
}
public function test_delete_competency_used_in_plan() {
public function test_delete_competency_used_in_plan(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3415,7 +3415,7 @@ class api_test extends \advanced_testcase {
$this->assertFalse(competency::record_exists($c12b->get('id')));
}
public function test_delete_competency_used_in_usercompetency() {
public function test_delete_competency_used_in_usercompetency(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3447,7 +3447,7 @@ class api_test extends \advanced_testcase {
$this->assertFalse(competency::record_exists($c12b->get('id')));
}
public function test_delete_competency_used_in_usercompetencyplan() {
public function test_delete_competency_used_in_usercompetencyplan(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3485,7 +3485,7 @@ class api_test extends \advanced_testcase {
$this->assertFalse(competency::record_exists($c12b->get('id')));
}
public function test_delete_competency_used_in_template() {
public function test_delete_competency_used_in_template(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3519,7 +3519,7 @@ class api_test extends \advanced_testcase {
$this->assertFalse(competency::record_exists($c12b->get('id')));
}
public function test_delete_competency_used_in_course() {
public function test_delete_competency_used_in_course(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3556,7 +3556,7 @@ class api_test extends \advanced_testcase {
$this->assertFalse(competency::record_exists($c12b->get('id')));
}
public function test_delete_framework() {
public function test_delete_framework(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3610,7 +3610,7 @@ class api_test extends \advanced_testcase {
$this->assertFalse(competency_framework::record_exists($f2->get('id')));
}
public function test_delete_framework_competency_used_in_plan() {
public function test_delete_framework_competency_used_in_plan(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3668,7 +3668,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(0, count(\core_competency\related_competency::get_multiple_relations(array($c2id))));
}
public function test_delete_framework_competency_used_in_usercompetency() {
public function test_delete_framework_competency_used_in_usercompetency(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3725,7 +3725,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(0, count(\core_competency\related_competency::get_multiple_relations(array($c2id))));
}
public function test_delete_framework_competency_used_in_usercompetencyplan() {
public function test_delete_framework_competency_used_in_usercompetencyplan(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3788,7 +3788,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(0, count(\core_competency\related_competency::get_multiple_relations(array($c2id))));
}
public function test_delete_framework_competency_used_in_template() {
public function test_delete_framework_competency_used_in_template(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3848,7 +3848,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(0, count(\core_competency\related_competency::get_multiple_relations(array($c2id))));
}
public function test_delete_framework_competency_used_in_course() {
public function test_delete_framework_competency_used_in_course(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -3910,7 +3910,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals(0, count(\core_competency\related_competency::get_multiple_relations(array($c2id))));
}
public function test_grade_competency_in_course_permissions() {
public function test_grade_competency_in_course_permissions(): void {
$this->resetAfterTest();
$dg = $this->getDataGenerator();
@@ -4061,7 +4061,7 @@ class api_test extends \advanced_testcase {
/**
* Test list of evidences for plan completed and not completed.
*/
public function test_list_evidence() {
public function test_list_evidence(): void {
global $DB;
$this->resetAfterTest(true);
@@ -4114,7 +4114,7 @@ class api_test extends \advanced_testcase {
/**
* Get a user competency in a course.
*/
public function test_get_user_competency_in_course() {
public function test_get_user_competency_in_course(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -4157,7 +4157,7 @@ class api_test extends \advanced_testcase {
/**
* Test course statistics api functions.
*/
public function test_course_statistics() {
public function test_course_statistics(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -4247,7 +4247,7 @@ class api_test extends \advanced_testcase {
/**
* Test template statistics api functions.
*/
public function test_template_statistics() {
public function test_template_statistics(): void {
$this->resetAfterTest(true);
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -4386,7 +4386,7 @@ class api_test extends \advanced_testcase {
}
}
public function test_is_scale_used_anywhere() {
public function test_is_scale_used_anywhere(): void {
$this->resetAfterTest();
$dg = $this->getDataGenerator();
$lpg = $dg->get_plugin_generator('core_competency');
@@ -4474,7 +4474,7 @@ class api_test extends \advanced_testcase {
$this->assertTrue(api::is_scale_used_anywhere($scale4->id));
}
public function test_delete_evidence() {
public function test_delete_evidence(): void {
$this->resetAfterTest();
$dg = $this->getDataGenerator();
$ccg = $dg->get_plugin_generator('core_competency');
@@ -4496,7 +4496,7 @@ class api_test extends \advanced_testcase {
$this->assertTrue(evidence::record_exists($ev2->get('id')));
}
public function test_delete_evidence_without_permissions() {
public function test_delete_evidence_without_permissions(): void {
$this->resetAfterTest();
$dg = $this->getDataGenerator();
$ccg = $dg->get_plugin_generator('core_competency');
@@ -4513,7 +4513,7 @@ class api_test extends \advanced_testcase {
api::delete_evidence($ev1);
}
public function test_list_plans_to_review() {
public function test_list_plans_to_review(): void {
$dg = $this->getDataGenerator();
$this->resetAfterTest();
$ccg = $dg->get_plugin_generator('core_competency');
@@ -4558,7 +4558,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($p1b->get('id'), $result['plans'][1]->plan->get('id'));
}
public function test_list_user_competencies_to_review() {
public function test_list_user_competencies_to_review(): void {
global $CFG;
require_once($CFG->dirroot . '/user/lib.php');
@@ -4626,7 +4626,7 @@ class api_test extends \advanced_testcase {
/**
* Test we can get all of a users plans with a competency.
*/
public function test_list_plans_with_competency() {
public function test_list_plans_with_competency(): void {
$this->resetAfterTest(true);
$this->setAdminUser();
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');