Merge branch 'MDL-81522_404' of https://github.com/stronk7/moodle into MOODLE_404_STABLE

This commit is contained in:
Huong Nguyen 2024-06-12 08:46:59 +07:00
commit 6d717d9c8a
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A
1366 changed files with 10086 additions and 10086 deletions

View File

@ -36,7 +36,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::get_metadata().
* @covers ::get_metadata
*/
public function test_get_metadata() {
public function test_get_metadata(): void {
$collection = new collection('core_adminpresets');
$newcollection = provider::get_metadata($collection);
$itemcollection = $newcollection->get_collection();
@ -49,7 +49,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::get_contexts_for_userid() doesn't return any context.
* @covers ::get_contexts_for_userid
*/
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
global $USER;
$this->resetAfterTest();
@ -67,7 +67,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::get_users_in_context() doesn't return any user.
* @covers ::get_users_in_context
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
global $USER;
$this->resetAfterTest();
@ -88,7 +88,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::export_user_data().
* @covers ::export_user_data
*/
public function test_export_user_data() {
public function test_export_user_data(): void {
global $USER;
$this->resetAfterTest();
@ -121,7 +121,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::delete_data_for_all_users_in_context().
* @covers ::delete_data_for_all_users_in_context
*/
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB, $USER;
$this->resetAfterTest();
@ -146,7 +146,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::delete_data_for_user().
* @covers ::delete_data_for_user
*/
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB, $USER;
$this->resetAfterTest();

View File

@ -27,7 +27,7 @@ use core_role_preset;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class preset_test extends \advanced_testcase {
public function test_xml() {
public function test_xml(): void {
global $DB;
$roles = $DB->get_records('role');
@ -81,7 +81,7 @@ class preset_test extends \advanced_testcase {
* Tests covered method.
* @covers \core_role_preset::parse_preset
*/
public function test_mixed_levels() {
public function test_mixed_levels(): void {
// The problem here is that we cannot guarantee plugin contexts
// have unique short names, so we have to also support level numbers.
$xml = file_get_contents(__DIR__ . '/fixtures/mixed_levels.xml');

View File

@ -45,7 +45,7 @@ class provider_test extends provider_testcase {
* Test to check export_user_preferences.
* returns user preferences data.
*/
public function test_export_user_preferences() {
public function test_export_user_preferences(): void {
$this->resetAfterTest();
$this->setAdminUser();
$user = $this->getDataGenerator()->create_user();
@ -64,7 +64,7 @@ class provider_test extends provider_testcase {
/**
* Check all contexts are returned if there is any user data for this user.
*/
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
global $DB;
$this->resetAfterTest();
@ -114,7 +114,7 @@ class provider_test extends provider_testcase {
/**
* Test that user data is exported correctly.
*/
public function test_export_user_data() {
public function test_export_user_data(): void {
global $DB;
$this->resetAfterTest();
@ -243,7 +243,7 @@ class provider_test extends provider_testcase {
/**
* Test for provider::delete_data_for_all_users_in_context().
*/
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB;
$this->resetAfterTest();
@ -329,7 +329,7 @@ class provider_test extends provider_testcase {
/**
* Test for provider::delete_data_for_user().
*/
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB;
$this->resetAfterTest();
@ -387,7 +387,7 @@ class provider_test extends provider_testcase {
/**
* Export for a user with a key against a script where no instance is specified.
*/
public function test_export_user_role_to_cohort() {
public function test_export_user_role_to_cohort(): void {
global $DB;
$this->resetAfterTest();
@ -443,7 +443,7 @@ class provider_test extends provider_testcase {
/**
* Test for provider::delete_user_role_to_cohort().
*/
public function test_delete_user_role_to_cohort() {
public function test_delete_user_role_to_cohort(): void {
global $DB;
$this->resetAfterTest();
@ -478,7 +478,7 @@ class provider_test extends provider_testcase {
/**
* Test that only users within a course context are fetched.
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
global $DB;
$this->resetAfterTest();
@ -599,7 +599,7 @@ class provider_test extends provider_testcase {
/**
* Test that data for users in approved userlist is deleted.
*/
public function test_delete_data_for_users() {
public function test_delete_data_for_users(): void {
global $DB;
$this->resetAfterTest();

View File

@ -30,7 +30,7 @@ class preset_deleted_test extends \advanced_testcase {
/**
* Test preset_deleted event.
*/
public function test_preset_deleted_event() {
public function test_preset_deleted_event(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -30,7 +30,7 @@ class preset_downloaded_test extends \advanced_testcase {
/**
* Test preset_downloaded event.
*/
public function test_preset_downloaded_event() {
public function test_preset_downloaded_event(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -30,7 +30,7 @@ class preset_exported_test extends \advanced_testcase {
/**
* Test preset_exported event.
*/
public function test_preset_exported_event() {
public function test_preset_exported_event(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -30,7 +30,7 @@ class preset_imported_test extends \advanced_testcase {
/**
* Test preset_imported event.
*/
public function test_preset_imported_event() {
public function test_preset_imported_event(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -30,7 +30,7 @@ class preset_loaded_test extends \advanced_testcase {
/**
* Test preset_loaded event.
*/
public function test_preset_loaded_event() {
public function test_preset_loaded_event(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -30,7 +30,7 @@ class preset_previewed_test extends \advanced_testcase {
/**
* Test preset_previewed event.
*/
public function test_preset_previewed_event() {
public function test_preset_previewed_event(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -30,7 +30,7 @@ class preset_reverted_test extends \advanced_testcase {
/**
* Test preset_reverted event.
*/
public function test_preset_reverted_event() {
public function test_preset_reverted_event(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -30,7 +30,7 @@ class presets_listed_test extends \advanced_testcase {
/**
* Test presets_listed event.
*/
public function test_presets_listed_event() {
public function test_presets_listed_event(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -50,7 +50,7 @@ class external_test extends externallib_advanced_testcase {
/**
* test_potential_contexts description
*/
public function test_potential_contexts() {
public function test_potential_contexts(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -71,7 +71,7 @@ class external_test extends externallib_advanced_testcase {
/**
* test_potential_contexts description
*/
public function test_potential_contexts_no_manager() {
public function test_potential_contexts_no_manager(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();

View File

@ -70,7 +70,7 @@ class behat_form_text_test extends \basic_testcase {
* @param mixed $expectation value to be checked.
* @dataProvider provider_test_set_get_value()
*/
public function test_set_get_value($value, $expectation) {
public function test_set_get_value($value, $expectation): void {
$session = $this->createMock(Session::class);
$node = $this->createMock(NodeElement::class);
$node->method('getValue')->willReturn($value);
@ -115,7 +115,7 @@ class behat_form_text_test extends \basic_testcase {
* @param bool $result expected return status of the function.
* @dataProvider provider_test_matches()
*/
public function test_matches($decsep, $value, $match, $result) {
public function test_matches($decsep, $value, $match, $result): void {
global $CFG;
// Switch of string manager to avoid having to (slow) customise the lang file.

View File

@ -35,7 +35,7 @@ class accessibility_test extends \advanced_testcase {
* @throws \dml_exception
* @throws \moodle_exception
*/
public function test_get_title() {
public function test_get_title(): void {
$this->resetAfterTest();
$object = new accessibility();
$filter = new filter();
@ -57,7 +57,7 @@ class accessibility_test extends \advanced_testcase {
*
* @throws \dml_exception
*/
public function test_check_ids() {
public function test_check_ids(): void {
$this->resetAfterTest();
$object = new accessibility();
@ -74,7 +74,7 @@ class accessibility_test extends \advanced_testcase {
*
* @throws \dml_exception
*/
public function test_get_translations() {
public function test_get_translations(): void {
$this->resetAfterTest();
$object = new accessibility();
@ -90,7 +90,7 @@ class accessibility_test extends \advanced_testcase {
*
* @throws \dml_exception
*/
public function test_get_category_courseids() {
public function test_get_category_courseids(): void {
$this->resetAfterTest();
$object = new accessibility();
$category = $this->getDataGenerator()->create_category();

View File

@ -32,7 +32,7 @@ class area_test extends area_test_base {
/**
* Test for the area assign intro
*/
public function test_assign() {
public function test_assign(): void {
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course();
$assign1 = $this->getDataGenerator()->create_module('assign', array(
@ -87,7 +87,7 @@ class area_test extends area_test_base {
/**
* Test for the area questiontext
*/
public function test_questiontext() {
public function test_questiontext(): void {
$this->resetAfterTest();
/** @var \core_question_generator $generator */
$generator = $this->getDataGenerator()->get_plugin_generator('core_question');
@ -147,7 +147,7 @@ class area_test extends area_test_base {
/**
* test for the area questionanswers
*/
public function test_questionanswers() {
public function test_questionanswers(): void {
global $DB;
$this->resetAfterTest();
@ -191,7 +191,7 @@ class area_test extends area_test_base {
/**
* Test for the areas choice intro and choice options
*/
public function test_choice() {
public function test_choice(): void {
global $DB;
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course();

View File

@ -27,7 +27,7 @@ use tool_brickfield\local\tool\filter;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class filters_test extends \advanced_testcase {
public function test_constructor() {
public function test_constructor(): void {
$this->resetAfterTest();
// Variables.
@ -56,7 +56,7 @@ class filters_test extends \advanced_testcase {
$this->assertEquals($object->url, $url);
}
public function test_get_course_sql() {
public function test_get_course_sql(): void {
$this->resetAfterTest();
$object = new filter();
@ -73,7 +73,7 @@ class filters_test extends \advanced_testcase {
}
public function test_validate_filters() {
public function test_validate_filters(): void {
$this->resetAfterTest();
// Variables.
$courseid = 0;
@ -102,7 +102,7 @@ class filters_test extends \advanced_testcase {
$this->assertFalse($output);
}
public function test_has_course_filters() {
public function test_has_course_filters(): void {
$this->resetAfterTest();
$object = new filter();
@ -114,7 +114,7 @@ class filters_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_has_capability_in_context() {
public function test_has_capability_in_context(): void {
global $DB;
$this->resetAfterTest();
@ -151,7 +151,7 @@ class filters_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_get_errormessage() {
public function test_get_errormessage(): void {
$this->resetAfterTest();
// Variables.
$courseid = 0;

View File

@ -36,7 +36,7 @@ class questionanswers_test extends \advanced_testcase {
/**
* Test find course areas.
*/
public function test_find_course_areas() {
public function test_find_course_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -122,7 +122,7 @@ class questionanswers_test extends \advanced_testcase {
/**
* Test find relevant areas.
*/
public function test_find_relevant_areas() {
public function test_find_relevant_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -153,7 +153,7 @@ class questionanswers_test extends \advanced_testcase {
/**
* Test find system areas.
*/
public function test_find_system_areas() {
public function test_find_system_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -42,7 +42,7 @@ class questiontext_test extends area_test_base {
/**
* Test find course areas.
*/
public function test_find_course_areas() {
public function test_find_course_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -126,7 +126,7 @@ class questiontext_test extends area_test_base {
/**
* Test find relevant areas.
*/
public function test_find_relevant_areas() {
public function test_find_relevant_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -156,7 +156,7 @@ class questiontext_test extends area_test_base {
/**
* Test find system areas.
*/
public function test_find_system_areas() {
public function test_find_system_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -197,7 +197,7 @@ class questiontext_test extends area_test_base {
*
* @covers ::get_course_and_category
*/
public function test_get_course_and_category() {
public function test_get_course_and_category(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -103,7 +103,7 @@ EOD;
/**
* Test for links opening a new tab or window
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'a');

View File

@ -64,7 +64,7 @@ EOD;
/**
* Test for anchor tags containing text
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'a');

View File

@ -90,7 +90,7 @@ EOD;
/**
* Test for anchor tags not containing susplicious link text
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);

View File

@ -103,7 +103,7 @@ EOD;
/**
* Test Area tags opening new window without warning
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'area');

View File

@ -64,7 +64,7 @@ EOD;
/**
* Test for area tags containing an alt value
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'area');

View File

@ -64,7 +64,7 @@ EOD;
/**
* Test for basefont tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'basefont');

View File

@ -64,7 +64,7 @@ EOD;
/**
* Test for blink tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'blink');

View File

@ -65,7 +65,7 @@ EOD;
/**
* Test for b tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'b');
$this->assertTrue($results[1]->element->tagName == 'b');

View File

@ -124,7 +124,7 @@ EOD;
/**
* Test for checking the length of the content
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->message == '<p id=\'wc\'>Word Count: 578</p>');

View File

@ -229,7 +229,7 @@ EOD;
/**
* Test for the area assign intro
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'p');
@ -255,7 +255,7 @@ EOD;
/**
* Test with valid colour names.
*/
public function test_check_for_namedcolours() {
public function test_check_for_namedcolours(): void {
$results = $this->get_checker_results($this->namecolours);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@ -263,7 +263,7 @@ EOD;
/**
* Test with invalid colour names.
*/
public function test_check_for_invalidcolours() {
public function test_check_for_invalidcolours(): void {
$results = $this->get_checker_results($this->invalidcolours);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@ -271,7 +271,7 @@ EOD;
/**
* Test with invalid colour numeric values.
*/
public function test_check_for_invalidvalues() {
public function test_check_for_invalidvalues(): void {
$results = $this->get_checker_results($this->invalidvalue);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@ -279,7 +279,7 @@ EOD;
/**
* Test with empty colour values.
*/
public function test_check_for_emptyvalues() {
public function test_check_for_emptyvalues(): void {
$results = $this->get_checker_results($this->emptyvalue);
$this->assertEmpty($results);
}
@ -287,7 +287,7 @@ EOD;
/**
* Test for text px18 with insufficient contrast of 4.49.
*/
public function test_check_for_px18_fail() {
public function test_check_for_px18_fail(): void {
$results = $this->get_checker_results($this->px18);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@ -295,7 +295,7 @@ EOD;
/**
* Test for text px19 bold with sufficient contrast of 4.49.
*/
public function test_check_for_px19bold_pass() {
public function test_check_for_px19bold_pass(): void {
$results = $this->get_checker_results($this->px19bold);
$this->assertEmpty($results);
}
@ -303,7 +303,7 @@ EOD;
/**
* Test for text px18 with sufficient contrast of 4.81.
*/
public function test_check_for_px18_pass() {
public function test_check_for_px18_pass(): void {
$results = $this->get_checker_results($this->px18pass);
$this->assertEmpty($results);
}
@ -311,7 +311,7 @@ EOD;
/**
* Test for medium (12pt) text with insufficient contrast of 4.49.
*/
public function test_check_for_medium_fail() {
public function test_check_for_medium_fail(): void {
$results = $this->get_checker_results($this->mediumfail);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@ -319,7 +319,7 @@ EOD;
/**
* Test for medium (12pt) text with sufficient contrast of 4.81.
*/
public function test_check_for_medium_pass() {
public function test_check_for_medium_pass(): void {
$results = $this->get_checker_results($this->mediumpass);
$this->assertEmpty($results);
}
@ -327,7 +327,7 @@ EOD;
/**
* Test for larger (14pt) text with insufficient contrast of 2.94.
*/
public function test_check_for_larger_fail() {
public function test_check_for_larger_fail(): void {
$results = $this->get_checker_results($this->largerfail);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@ -335,7 +335,7 @@ EOD;
/**
* Test for larger (14pt) text with insufficient contrast of 3.02.
*/
public function test_check_for_larger_pass() {
public function test_check_for_larger_pass(): void {
$results = $this->get_checker_results($this->largerpass);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@ -343,7 +343,7 @@ EOD;
/**
* Test for larger (14pt) bold text with sufficient contrast of 3.02.
*/
public function test_check_for_largerbold_pass() {
public function test_check_for_largerbold_pass(): void {
$results = $this->get_checker_results($this->largerboldpass);
$this->assertEmpty($results);
}

View File

@ -81,7 +81,7 @@ EOD;
/**
* Test for noembed child tags
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'embed');

View File

@ -122,7 +122,7 @@ EOD;
/**
* Test the header following an h3 must be h1, h2, h3 or h4.
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'h5');

View File

@ -76,7 +76,7 @@ EOD;
/**
* Test for headers not containing text
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'h2');

View File

@ -64,7 +64,7 @@ EOD;
/**
* Test for i tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'i');

View File

@ -64,7 +64,7 @@ EOD;
/**
* Test for img alt attributes matching the src attribute
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'img');

View File

@ -68,7 +68,7 @@ EOD;
/**
* Test for image alt attributes being too long
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'img');

View File

@ -63,7 +63,7 @@ EOD;
/**
* Test for >Anchor tags containing a nested img tag, must not have an empty alt attribute
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'img');

View File

@ -133,7 +133,7 @@ EOD;
/**
* Test for the each en string specified in $strings - line 43 in imgAltNotPlaceHolder.
*/
public function test_failcheck() {
public function test_failcheck(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'img');
@ -156,7 +156,7 @@ EOD;
/**
* Test with alt that was not specified in the $strings array.
*/
public function test_passcheck1() {
public function test_passcheck1(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);
}

View File

@ -76,7 +76,7 @@ EOD;
/**
* Test for missing image alt text.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'img');
@ -87,7 +87,7 @@ EOD;
/**
* Test for present image alt text.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertTrue(count($results) == 0);
}

View File

@ -66,7 +66,7 @@ EOD;
/**
* Test for usemap attribute.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'img');
}
@ -74,7 +74,7 @@ EOD;
/**
* Test for ismap attribute.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}

View File

@ -76,7 +76,7 @@ EOD;
/**
* Test for if legend is empty or only has white spaces.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'legend');
@ -87,7 +87,7 @@ EOD;
/**
* Test for if legend has text.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}

View File

@ -254,7 +254,7 @@ EOD;
/**
* Test for if heading exists where doc length is above 1800
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertNotEmpty($results);
@ -263,7 +263,7 @@ EOD;
/**
* Test for if marquee does not exist.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);

View File

@ -66,7 +66,7 @@ EOD;
/**
* Test for missing embed element within object element.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'object');
}
@ -74,7 +74,7 @@ EOD;
/**
* Test for present embed element within object element.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}

View File

@ -63,7 +63,7 @@ EOD;
/**
* Test for missing title attribute within object element.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'object');
}
@ -71,7 +71,7 @@ EOD;
/**
* Test for present title attribute within object element.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}

View File

@ -129,7 +129,7 @@ EOD;
/**
* Test that embed element within object element.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'object');
}
@ -137,7 +137,7 @@ EOD;
/**
* Test for embed element within object element.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);

View File

@ -77,7 +77,7 @@ EOD;
/**
* Test for b tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'strike');

View File

@ -117,7 +117,7 @@ EOD;
/**
* Test that th does not exist
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'table');
@ -128,7 +128,7 @@ EOD;
/**
* Test that th does exist
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);

View File

@ -67,7 +67,7 @@ EOD;
/**
* Test that caption and summary are equal
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'table');
}
@ -75,7 +75,7 @@ EOD;
/**
* Test that caption and summary are not equal
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}

View File

@ -125,7 +125,7 @@ EOD;
/**
* Test for rowspan and colspan
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertNotEmpty($results);
@ -136,7 +136,7 @@ EOD;
/**
* Test for rowspan and colspan
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}

View File

@ -163,7 +163,7 @@ EOD;
/**
* Test that th has scope that is equal to col or row
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertEquals(2, count($results));
$this->assertTrue($results[0]->element->tagName == 'th');
@ -177,7 +177,7 @@ EOD;
/**
* Test that th has scope but != col || row. Test that th has no scope
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);

View File

@ -26,7 +26,7 @@ namespace tool_brickfield\local\tool;
*/
class activityresults_test extends \advanced_testcase {
public function test_toolname() {
public function test_toolname(): void {
$this->resetAfterTest();
$object = new activityresults();
@ -34,7 +34,7 @@ class activityresults_test extends \advanced_testcase {
$this->assertEquals($output, 'Activity breakdown summary');
}
public function test_toolshortname() {
public function test_toolshortname(): void {
$this->resetAfterTest();
$object = new activityresults();
@ -42,7 +42,7 @@ class activityresults_test extends \advanced_testcase {
$this->assertEquals($output, 'Activity breakdown');
}
public function test_pluginname() {
public function test_pluginname(): void {
$this->resetAfterTest();
$object = new activityresults();
@ -50,7 +50,7 @@ class activityresults_test extends \advanced_testcase {
$this->assertEquals($output, 'activityresults');
}
public function test_get_output() {
public function test_get_output(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();

View File

@ -26,7 +26,7 @@ namespace tool_brickfield\local\tool;
*/
class checktyperesults_test extends \advanced_testcase {
public function test_toolname() {
public function test_toolname(): void {
$this->resetAfterTest();
$object = new checktyperesults();
@ -34,7 +34,7 @@ class checktyperesults_test extends \advanced_testcase {
$this->assertEquals($output, 'Content types summary');
}
public function test_toolshortname() {
public function test_toolshortname(): void {
$this->resetAfterTest();
$object = new checktyperesults();
@ -42,7 +42,7 @@ class checktyperesults_test extends \advanced_testcase {
$this->assertEquals($output, 'Content types');
}
public function test_pluginname() {
public function test_pluginname(): void {
$this->resetAfterTest();
$object = new checktyperesults();
@ -50,7 +50,7 @@ class checktyperesults_test extends \advanced_testcase {
$this->assertEquals($output, 'checktyperesults');
}
public function test_get_output() {
public function test_get_output(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();

View File

@ -26,7 +26,7 @@ namespace tool_brickfield\local\tool;
*/
class errors_test extends \advanced_testcase {
public function test_toolname() {
public function test_toolname(): void {
$this->resetAfterTest();
$object = new errors();
@ -34,7 +34,7 @@ class errors_test extends \advanced_testcase {
$this->assertEquals($output, 'Error list summary');
}
public function test_toolshortname() {
public function test_toolshortname(): void {
$this->resetAfterTest();
$object = new errors();
@ -42,7 +42,7 @@ class errors_test extends \advanced_testcase {
$this->assertEquals($output, 'Error list');
}
public function test_pluginname() {
public function test_pluginname(): void {
$this->resetAfterTest();
$object = new errors();
@ -50,7 +50,7 @@ class errors_test extends \advanced_testcase {
$this->assertEquals($output, 'errors');
}
public function test_get_output() {
public function test_get_output(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();

View File

@ -29,7 +29,7 @@ class printable_test extends \advanced_testcase {
/**
* Test tool name.
*/
public function test_toolname() {
public function test_toolname(): void {
$this->resetAfterTest();
$object = new printable();
@ -40,7 +40,7 @@ class printable_test extends \advanced_testcase {
/**
* Test tool short name.
*/
public function test_toolshortname() {
public function test_toolshortname(): void {
$this->resetAfterTest();
$object = new printable();
@ -51,7 +51,7 @@ class printable_test extends \advanced_testcase {
/**
* Test plugin name.
*/
public function test_pluginname() {
public function test_pluginname(): void {
$this->resetAfterTest();
$object = new printable();
@ -77,7 +77,7 @@ class printable_test extends \advanced_testcase {
/**
* Test get output.
*/
public function test_get_output() {
public function test_get_output(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();

View File

@ -28,7 +28,7 @@ class manager_test extends \advanced_testcase {
/**
* Tests for the function manager::get_all_areas()
*/
public function test_get_areas() {
public function test_get_areas(): void {
$this->resetAfterTest();
$areas = manager::get_all_areas();
$areaclassnames = array_map('get_class', $areas);

View File

@ -40,7 +40,7 @@ class registration_test extends \advanced_testcase {
* Tests the state of the registration system when first installed.
* @throws \dml_exception
*/
public function test_initial_state() {
public function test_initial_state(): void {
$this->resetAfterTest();
$regobj = new mock_registration();
@ -56,7 +56,7 @@ class registration_test extends \advanced_testcase {
* Test the various states for setting registration keys.
* @throws \dml_exception
*/
public function test_set_keys_for_registration() {
public function test_set_keys_for_registration(): void {
$this->resetAfterTest();
$regobj = new mock_registration();
@ -79,7 +79,7 @@ class registration_test extends \advanced_testcase {
* Test the validation system through its several states.
* @throws \dml_exception
*/
public function test_validation() {
public function test_validation(): void {
$this->resetAfterTest();
$regobj = new mock_registration();
@ -112,7 +112,7 @@ class registration_test extends \advanced_testcase {
* Tests the system after validation grace periods expire.
* @throws \dml_exception
*/
public function test_validation_time_expiry() {
public function test_validation_time_expiry(): void {
$this->resetAfterTest();
$regobj = new mock_registration();
@ -149,7 +149,7 @@ class registration_test extends \advanced_testcase {
* Tests the system after summary data time periods expire.
* @throws \dml_exception
*/
public function test_summary_time_expiry() {
public function test_summary_time_expiry(): void {
$this->resetAfterTest();
$regobj = new mock_registration();

View File

@ -26,7 +26,7 @@ namespace tool_brickfield;
*/
class scheduler_test extends \advanced_testcase {
public function test_request_analysis() {
public function test_request_analysis(): void {
$this->resetAfterTest();
// I believe there is a bug where the code won't work with the default constructor values.
@ -48,7 +48,7 @@ class scheduler_test extends \advanced_testcase {
}
public function test_mark_analyzed() {
public function test_mark_analyzed(): void {
$this->resetAfterTest();
$object = new scheduler();
$output = $object->mark_analyzed();
@ -59,7 +59,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_create_schedule() {
public function test_create_schedule(): void {
global $DB;
$this->resetAfterTest();
@ -76,7 +76,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertEquals($record->instanceid, 1);
}
public function test_delete_schedule() {
public function test_delete_schedule(): void {
global $DB;
// Call create_record() to insert a record into the table.
@ -95,7 +95,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertFalse($record);
}
public function test_is_in_schedule() {
public function test_is_in_schedule(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@ -109,7 +109,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_scheduled() {
public function test_is_scheduled(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@ -129,7 +129,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_submitted() {
public function test_is_submitted(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@ -149,7 +149,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_analyzed() {
public function test_is_analyzed(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@ -170,14 +170,14 @@ class scheduler_test extends \advanced_testcase {
}
// Can't test because it's a protected function.
public function test_standard_search_params() {
public function test_standard_search_params(): void {
}
// Can't test because it's a protected function.
public function test_get_contextid() {
public function test_get_contextid(): void {
}
public function test_get_datarecord() {
public function test_get_datarecord(): void {
$this->resetAfterTest();
$object = new scheduler();
@ -200,11 +200,11 @@ class scheduler_test extends \advanced_testcase {
}
// No return statement.
public function test_process_scheduled_requests() {
public function test_process_scheduled_requests(): void {
}
public function test_initialize_schedule() {
public function test_initialize_schedule(): void {
global $DB;
$this->resetAfterTest();
@ -219,14 +219,14 @@ class scheduler_test extends \advanced_testcase {
$this->assertEquals($record->contextlevel, 20);
}
public function test_request_course_analysis() {
public function test_request_course_analysis(): void {
$this->resetAfterTest();
$output = scheduler::request_course_analysis(1);
$this->assertTrue($output);
}
public function test_create_course_schedule() {
public function test_create_course_schedule(): void {
global $DB;
$this->resetAfterTest();
@ -237,7 +237,7 @@ class scheduler_test extends \advanced_testcase {
}
public function test_delete_course_schedule() {
public function test_delete_course_schedule(): void {
global $DB;
$this->resetAfterTest();
@ -251,7 +251,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertFalse($record);
}
public function test_is_course_in_schedule() {
public function test_is_course_in_schedule(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@ -264,7 +264,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_course_scheduled() {
public function test_is_course_scheduled(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@ -283,7 +283,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_course_analyzed() {
public function test_is_course_analyzed(): void {
$this->resetAfterTest();
$object = new scheduler(10, 1);

View File

@ -58,7 +58,7 @@ w==" alt="This is a bus." />';
EOF;
public function test_build_all_accessibilitytools() {
public function test_build_all_accessibilitytools(): void {
$tools = tool::build_all_accessibilitytools();
$this->assertEquals($tools['errors']::toolshortname(), 'Error list');
@ -68,14 +68,14 @@ EOF;
$this->assertEquals($tools['advanced']::toolshortname(), 'Advanced');
}
public function test_data_is_valid() {
public function test_data_is_valid(): void {
$object = $this->getMockForAbstractClass(tool::class);
$object->set_filter(new filter());
$output = $object->data_is_valid();
$this->assertFalse($output);
}
public function test_can_access() {
public function test_can_access(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();
$filter = new filter(1, $category->id, 'tab', 3, 4);
@ -86,14 +86,14 @@ EOF;
$this->assertFalse($output);
}
public function test_get_error_message() {
public function test_get_error_message(): void {
$tool = $this->getMockForAbstractClass(tool::class);
$output = $tool->get_error_message();
$this->assertEquals($output, '');
}
public function test_get_module_label() {
public function test_get_module_label(): void {
$output = tool::get_module_label('core_course');
$this->assertEquals($output, 'Course');
@ -101,7 +101,7 @@ EOF;
$this->assertEquals($output, 'Book');
}
public function test_toplevel_arguments() {
public function test_toplevel_arguments(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();
$filter = new filter(1, $category->id, 'tab', 3, 4);
@ -154,14 +154,14 @@ EOF;
* @param string $content
* @param bool $expectation
*/
public function test_base64_img_detected(string $content, bool $expectation) {
public function test_base64_img_detected(string $content, bool $expectation): void {
$this->assertEquals(
$expectation,
tool::base64_img_detected($content)
);
}
public function test_truncate_base64() {
public function test_truncate_base64(): void {
$truncated = tool::truncate_base64($this->base64img);
$this->assertStringContainsString('<img src="data:image/gif;base64..."', $truncated);
}

View File

@ -44,7 +44,7 @@ class events_test extends \advanced_testcase {
/**
* Test the report viewed event.
*/
public function test_report_viewed() {
public function test_report_viewed(): void {
$event = \tool_capability\event\report_viewed::create();
// Trigger and capture the event.

View File

@ -36,7 +36,7 @@ class locallib_test extends \advanced_testcase {
/**
* Test the function that gets the data - simple case.
*/
public function test_tool_capability_calculate_role_data() {
public function test_tool_capability_calculate_role_data(): void {
global $DB;
$data = tool_capability_calculate_role_data('mod/quiz:attempt', get_all_roles());
@ -58,7 +58,7 @@ class locallib_test extends \advanced_testcase {
/**
* Test the function that gets the data - simple case.
*/
public function test_tool_capability_calculate_role_data_orphan_contexts() {
public function test_tool_capability_calculate_role_data_orphan_contexts(): void {
global $DB;
$this->resetAfterTest();

View File

@ -53,7 +53,7 @@ class api_test extends \advanced_testcase {
cohort_add_member($this->cohort->id, $this->userassignover->id);
}
public function test_create_cohort_role_assignment_without_permission() {
public function test_create_cohort_role_assignment_without_permission(): void {
$this->setUser($this->userassignto);
$params = (object) array(
'userid' => $this->userassignto->id,
@ -64,7 +64,7 @@ class api_test extends \advanced_testcase {
api::create_cohort_role_assignment($params);
}
public function test_create_cohort_role_assignment_with_invalid_data() {
public function test_create_cohort_role_assignment_with_invalid_data(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@ -75,7 +75,7 @@ class api_test extends \advanced_testcase {
api::create_cohort_role_assignment($params);
}
public function test_create_cohort_role_assignment() {
public function test_create_cohort_role_assignment(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@ -89,7 +89,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($result->get('cohortid'), $this->cohort->id);
}
public function test_delete_cohort_role_assignment_without_permission() {
public function test_delete_cohort_role_assignment_without_permission(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@ -102,7 +102,7 @@ class api_test extends \advanced_testcase {
api::delete_cohort_role_assignment($result->get('id'));
}
public function test_delete_cohort_role_assignment_with_invalid_data() {
public function test_delete_cohort_role_assignment_with_invalid_data(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@ -114,7 +114,7 @@ class api_test extends \advanced_testcase {
api::delete_cohort_role_assignment($result->get('id') + 1);
}
public function test_delete_cohort_role_assignment() {
public function test_delete_cohort_role_assignment(): void {
$this->setAdminUser();
// Create a cohort role assigment.
$params = (object) [
@ -151,7 +151,7 @@ class api_test extends \advanced_testcase {
/**
* Test case verifying that syncing won't remove role assignments if they are valid for another cohort role assignment.
*/
public function test_delete_cohort_role_assignment_cohorts_having_same_members() {
public function test_delete_cohort_role_assignment_cohorts_having_same_members(): void {
$this->setAdminUser();
// Create 2 cohorts, with a 1 user (user1) present in both,
@ -203,7 +203,7 @@ class api_test extends \advanced_testcase {
$this->assertContains($user2->id, $removedusers);
}
public function test_list_cohort_role_assignments() {
public function test_list_cohort_role_assignments(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@ -217,7 +217,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($list[0], $result);
}
public function test_count_cohort_role_assignments() {
public function test_count_cohort_role_assignments(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@ -230,7 +230,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($count, 1);
}
public function test_sync_all_cohort_roles() {
public function test_sync_all_cohort_roles(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,

View File

@ -51,7 +51,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test for provider::get_contexts_for_userid().
*/
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
global $DB;
// Test setup.
@ -94,7 +94,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test for provider::export_user_data().
*/
public function test_export_user_data() {
public function test_export_user_data(): void {
// Test setup.
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
@ -144,7 +144,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test for provider::delete_data_for_all_users_in_context().
*/
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB;
// Test setup.
@ -203,7 +203,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test for provider::delete_data_for_user().
*/
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB;
// Test setup.
@ -251,7 +251,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test that only users within a course context are fetched.
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
$component = 'tool_cohortroles';
// Create a user.
@ -293,7 +293,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test that data for users in approved userlist is deleted.
*/
public function test_delete_data_for_users() {
public function test_delete_data_for_users(): void {
$component = 'tool_cohortroles';
// Create user1.

View File

@ -37,7 +37,7 @@ class api_test extends \advanced_testcase {
* Ensure that the check_can_manage_data_registry function fails cap testing when a user without capabilities is
* tested with the default context.
*/
public function test_check_can_manage_data_registry_admin() {
public function test_check_can_manage_data_registry_admin(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -49,7 +49,7 @@ class api_test extends \advanced_testcase {
* Ensure that the check_can_manage_data_registry function fails cap testing when a user without capabilities is
* tested with the default context.
*/
public function test_check_can_manage_data_registry_without_cap_default() {
public function test_check_can_manage_data_registry_without_cap_default(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -63,7 +63,7 @@ class api_test extends \advanced_testcase {
* Ensure that the check_can_manage_data_registry function fails cap testing when a user without capabilities is
* tested with the default context.
*/
public function test_check_can_manage_data_registry_without_cap_system() {
public function test_check_can_manage_data_registry_without_cap_system(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -77,7 +77,7 @@ class api_test extends \advanced_testcase {
* Ensure that the check_can_manage_data_registry function fails cap testing when a user without capabilities is
* tested with the default context.
*/
public function test_check_can_manage_data_registry_without_cap_own_user() {
public function test_check_can_manage_data_registry_without_cap_own_user(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -90,7 +90,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::update_request_status().
*/
public function test_update_request_status() {
public function test_update_request_status(): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@ -138,7 +138,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::get_site_dpos() when there are no users with the DPO role.
*/
public function test_get_site_dpos_no_dpos() {
public function test_get_site_dpos_no_dpos(): void {
$this->resetAfterTest();
$admin = get_admin();
@ -152,7 +152,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::get_site_dpos() when there are no users with the DPO role.
*/
public function test_get_site_dpos() {
public function test_get_site_dpos(): void {
global $DB;
$this->resetAfterTest();
@ -189,7 +189,7 @@ class api_test extends \advanced_testcase {
/**
* Test for \tool_dataprivacy\api::get_assigned_privacy_officer_roles().
*/
public function test_get_assigned_privacy_officer_roles() {
public function test_get_assigned_privacy_officer_roles(): void {
global $DB;
$this->resetAfterTest();
@ -232,7 +232,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::approve_data_request().
*/
public function test_approve_data_request() {
public function test_approve_data_request(): void {
global $DB;
$this->resetAfterTest();
@ -276,7 +276,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::approve_data_request() when allow filtering of exports by course.
*/
public function test_approve_data_request_with_allow_filtering() {
public function test_approve_data_request_with_allow_filtering(): void {
global $DB;
$this->resetAfterTest();
set_config('allowfiltering', 1, 'tool_dataprivacy');
@ -325,7 +325,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::approve_data_request() when called by a user who doesn't have the DPO role.
*/
public function test_approve_data_request_non_dpo_user() {
public function test_approve_data_request_non_dpo_user(): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@ -347,7 +347,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::add_request_contexts_with_status().
*/
public function test_add_request_contexts_with_status() {
public function test_add_request_contexts_with_status(): void {
global $DB;
$this->resetAfterTest();
set_config('allowfiltering', 1, 'tool_dataprivacy');
@ -385,7 +385,7 @@ class api_test extends \advanced_testcase {
/**
* Test that deletion requests for the primary admin are rejected
*/
public function test_reject_data_deletion_request_primary_admin() {
public function test_reject_data_deletion_request_primary_admin(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -408,7 +408,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::can_contact_dpo()
*/
public function test_can_contact_dpo() {
public function test_can_contact_dpo(): void {
$this->resetAfterTest();
// Default ('contactdataprotectionofficer' is disabled by default).
@ -426,7 +426,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::can_manage_data_requests()
*/
public function test_can_manage_data_requests() {
public function test_can_manage_data_requests(): void {
global $DB;
$this->resetAfterTest();
@ -471,7 +471,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has no capability to make any data requests for children cannot create data requests for any
* other user.
*/
public function test_can_create_data_request_for_user_no() {
public function test_can_create_data_request_for_user_no(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@ -485,7 +485,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has the capability to make any data requests for one other user cannot create data requests
* for any other user.
*/
public function test_can_create_data_request_for_user_some() {
public function test_can_create_data_request_for_user_some(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@ -505,7 +505,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has the capability to make any data requests for one other user cannot create data requests
* for any other user.
*/
public function test_can_create_data_request_for_user_own_child() {
public function test_can_create_data_request_for_user_own_child(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@ -524,7 +524,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has no capability to make any data requests for children cannot create data requests for any
* other user.
*/
public function test_require_can_create_data_request_for_user_no() {
public function test_require_can_create_data_request_for_user_no(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@ -539,7 +539,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has the capability to make any data requests for one other user cannot create data requests
* for any other user.
*/
public function test_require_can_create_data_request_for_user_some() {
public function test_require_can_create_data_request_for_user_some(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@ -560,7 +560,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has the capability to make any data requests for one other user cannot create data requests
* for any other user.
*/
public function test_require_can_create_data_request_for_user_own_child() {
public function test_require_can_create_data_request_for_user_own_child(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@ -578,7 +578,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::can_download_data_request_for_user()
*/
public function test_can_download_data_request_for_user() {
public function test_can_download_data_request_for_user(): void {
$this->resetAfterTest();
$generator = $this->getDataGenerator();
@ -700,7 +700,7 @@ class api_test extends \advanced_testcase {
$expectedstatus,
$expectedtaskcount,
$allowfiltering,
) {
): void {
global $USER;
$this->resetAfterTest();
@ -751,7 +751,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::create_data_request() made by a parent.
*/
public function test_create_data_request_by_parent() {
public function test_create_data_request_by_parent(): void {
global $DB;
$this->resetAfterTest();
@ -786,7 +786,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::deny_data_request()
*/
public function test_deny_data_request() {
public function test_deny_data_request(): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@ -841,7 +841,7 @@ class api_test extends \advanced_testcase {
* @param boolean $fetchall Whether to fetch all records.
* @param int[] $statuses Status filters.
*/
public function test_get_data_requests($usertype, $fetchall, $statuses) {
public function test_get_data_requests($usertype, $fetchall, $statuses): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@ -952,7 +952,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::get_approved_contextlist_collection_for_request.
*/
public function test_get_approved_contextlist_collection_for_request() {
public function test_get_approved_contextlist_collection_for_request(): void {
$this->resetAfterTest();
set_config('allowfiltering', 1, 'tool_dataprivacy');
$this->setAdminUser();
@ -1021,7 +1021,7 @@ class api_test extends \advanced_testcase {
* @param int $status The request status.
* @param bool $expected The expected result.
*/
public function test_has_ongoing_request($status, $expected) {
public function test_has_ongoing_request($status, $expected): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@ -1045,7 +1045,7 @@ class api_test extends \advanced_testcase {
* @param int $status The request status
* @param bool $expected The expected result
*/
public function test_is_active($status, $expected) {
public function test_is_active($status, $expected): void {
// Check if this request is ongoing.
$result = api::is_active($status);
$this->assertEquals($expected, $result);
@ -1054,7 +1054,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::is_site_dpo()
*/
public function test_is_site_dpo() {
public function test_is_site_dpo(): void {
global $DB;
$this->resetAfterTest();
@ -1108,7 +1108,7 @@ class api_test extends \advanced_testcase {
* @param string $typestringid The request lang string identifier
* @param string $comments The requestor's message to the DPO.
*/
public function test_notify_dpo($byadmin, $type, $typestringid, $comments) {
public function test_notify_dpo($byadmin, $type, $typestringid, $comments): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@ -1150,7 +1150,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_purpose_crud() {
public function test_purpose_crud(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -1192,7 +1192,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_category_crud() {
public function test_category_crud(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -1230,7 +1230,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_context_instances() {
public function test_context_instances(): void {
global $DB;
$this->resetAfterTest();
@ -1266,7 +1266,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_contextlevel() {
public function test_contextlevel(): void {
global $DB;
$this->resetAfterTest();
@ -1302,7 +1302,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_effective_contextlevel_defaults() {
public function test_effective_contextlevel_defaults(): void {
$this->setAdminUser();
$this->resetAfterTest();
@ -1340,7 +1340,7 @@ class api_test extends \advanced_testcase {
/**
* Ensure that when nothing is configured, all values return false.
*/
public function test_get_effective_contextlevel_unset() {
public function test_get_effective_contextlevel_unset(): void {
// Before setup, get_effective_contextlevel_purpose will return false.
$this->assertFalse(api::get_effective_contextlevel_category(CONTEXT_SYSTEM));
$this->assertFalse(api::get_effective_contextlevel_purpose(CONTEXT_SYSTEM));
@ -1352,7 +1352,7 @@ class api_test extends \advanced_testcase {
/**
* Ensure that when nothing is configured, all values return false.
*/
public function test_get_effective_context_unset() {
public function test_get_effective_context_unset(): void {
// Before setup, get_effective_contextlevel_purpose will return false.
$this->assertFalse(api::get_effective_context_category(\context_system::instance()));
$this->assertFalse(api::get_effective_context_purpose(\context_system::instance()));
@ -1364,7 +1364,7 @@ class api_test extends \advanced_testcase {
* @dataProvider invalid_effective_contextlevel_provider
* @param int $contextlevel
*/
public function test_set_contextlevel_invalid_contextlevels($contextlevel) {
public function test_set_contextlevel_invalid_contextlevels($contextlevel): void {
$this->expectException(\coding_exception::class);
api::set_contextlevel((object) [
@ -1376,7 +1376,7 @@ class api_test extends \advanced_testcase {
/**
* Test effective contextlevel return.
*/
public function test_effective_contextlevel() {
public function test_effective_contextlevel(): void {
$this->resetAfterTest();
// Set the initial purpose and category.
@ -1424,7 +1424,7 @@ class api_test extends \advanced_testcase {
* @dataProvider invalid_effective_contextlevel_provider
* @param int $contextlevel
*/
public function test_effective_contextlevel_invalid_contextlevels($contextlevel) {
public function test_effective_contextlevel_invalid_contextlevels($contextlevel): void {
$this->resetAfterTest();
$purpose1 = api::create_purpose((object)['name' => 'p1', 'retentionperiod' => 'PT1H', 'lawfulbases' => 'gdpr_art_6_1_a']);
@ -1454,7 +1454,7 @@ class api_test extends \advanced_testcase {
/**
* Ensure that context inheritance works up the context tree.
*/
public function test_effective_context_inheritance() {
public function test_effective_context_inheritance(): void {
$this->resetAfterTest();
$systemdata = $this->create_and_set_purpose_for_contextlevel('PT1S', CONTEXT_SYSTEM);
@ -1734,7 +1734,7 @@ class api_test extends \advanced_testcase {
* Although it should not be possible to set hard INHERIT values at this level, there may be legacy data which still
* contains this.
*/
public function test_effective_context_inheritance_explicitly_set() {
public function test_effective_context_inheritance_explicitly_set(): void {
$this->resetAfterTest();
$systemdata = $this->create_and_set_purpose_for_contextlevel('PT1S', CONTEXT_SYSTEM);
@ -1861,7 +1861,7 @@ class api_test extends \advanced_testcase {
/**
* Test that delete requests do not filter out protected purpose contexts if the the site is properly configured.
*/
public function test_get_approved_contextlist_collection_for_collection_delete_course_no_site_config() {
public function test_get_approved_contextlist_collection_for_collection_delete_course_no_site_config(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -1903,7 +1903,7 @@ class api_test extends \advanced_testcase {
/**
* Test that delete requests do not filter out protected purpose contexts if they are already expired.
*/
public function test_get_approved_contextlist_collection_for_collection_delete_course_expired_protected() {
public function test_get_approved_contextlist_collection_for_collection_delete_course_expired_protected(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -1936,7 +1936,7 @@ class api_test extends \advanced_testcase {
/**
* Test that delete requests does filter out protected purpose contexts which are not expired.
*/
public function test_get_approved_contextlist_collection_for_collection_delete_course_unexpired_protected() {
public function test_get_approved_contextlist_collection_for_collection_delete_course_unexpired_protected(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1Y');
@ -1969,7 +1969,7 @@ class api_test extends \advanced_testcase {
/**
* Test that delete requests do not filter out unexpired contexts if they are not protected.
*/
public function test_get_approved_contextlist_collection_for_collection_delete_course_unexpired_unprotected() {
public function test_get_approved_contextlist_collection_for_collection_delete_course_unexpired_unprotected(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1Y');
@ -2040,7 +2040,7 @@ class api_test extends \advanced_testcase {
* @param bool $foractivity Whether to set defaults for an activity.
* @param bool $override Whether to override instances.
*/
public function test_set_context_defaults($contextlevel, $inheritcategory, $inheritpurpose, $foractivity, $override) {
public function test_set_context_defaults($contextlevel, $inheritcategory, $inheritpurpose, $foractivity, $override): void {
$this->resetAfterTest();
$generator = $this->getDataGenerator();
@ -2224,7 +2224,7 @@ class api_test extends \advanced_testcase {
/**
* Ensure that the find_ongoing_request_types_for_users only returns requests which are active.
*/
public function test_find_ongoing_request_types_for_users() {
public function test_find_ongoing_request_types_for_users(): void {
$this->resetAfterTest();
// Create users and their requests:.
@ -2360,7 +2360,7 @@ class api_test extends \advanced_testcase {
*
* @throws coding_exception
*/
public function test_can_create_data_deletion_request_for_self_no() {
public function test_can_create_data_deletion_request_for_self_no(): void {
$this->resetAfterTest();
$userid = $this->getDataGenerator()->create_user()->id;
$roleid = $this->getDataGenerator()->create_role();
@ -2373,7 +2373,7 @@ class api_test extends \advanced_testcase {
/**
* Test primary admin cannot create data deletion request for themselves
*/
public function test_can_create_data_deletion_request_for_self_primary_admin() {
public function test_can_create_data_deletion_request_for_self_primary_admin(): void {
$this->resetAfterTest();
$this->setAdminUser();
$this->assertFalse(api::can_create_data_deletion_request_for_self());
@ -2382,7 +2382,7 @@ class api_test extends \advanced_testcase {
/**
* Test secondary admin can create data deletion request for themselves
*/
public function test_can_create_data_deletion_request_for_self_secondary_admin() {
public function test_can_create_data_deletion_request_for_self_secondary_admin(): void {
$this->resetAfterTest();
$admin1 = $this->getDataGenerator()->create_user();
@ -2403,7 +2403,7 @@ class api_test extends \advanced_testcase {
*
* @throws coding_exception
*/
public function test_can_create_data_deletion_request_for_self_yes() {
public function test_can_create_data_deletion_request_for_self_yes(): void {
$this->resetAfterTest();
$userid = $this->getDataGenerator()->create_user()->id;
$this->setUser($userid);
@ -2417,7 +2417,7 @@ class api_test extends \advanced_testcase {
* @throws coding_exception
* @throws dml_exception
*/
public function test_can_create_data_deletion_request_for_other_no() {
public function test_can_create_data_deletion_request_for_other_no(): void {
$this->resetAfterTest();
$userid = $this->getDataGenerator()->create_user()->id;
$this->setUser($userid);
@ -2430,7 +2430,7 @@ class api_test extends \advanced_testcase {
*
* @throws coding_exception
*/
public function test_can_create_data_deletion_request_for_other_yes() {
public function test_can_create_data_deletion_request_for_other_yes(): void {
$this->resetAfterTest();
$userid = $this->getDataGenerator()->create_user()->id;
$roleid = $this->getDataGenerator()->create_role();
@ -2448,7 +2448,7 @@ class api_test extends \advanced_testcase {
* @throws coding_exception
* @throws dml_exception
*/
public function test_can_create_data_deletion_request_for_children() {
public function test_can_create_data_deletion_request_for_children(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@ -2490,7 +2490,7 @@ class api_test extends \advanced_testcase {
* @dataProvider queue_data_request_task_provider
* @param bool $withuserid
*/
public function test_queue_data_request_task(bool $withuserid) {
public function test_queue_data_request_task(bool $withuserid): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -2546,7 +2546,7 @@ class api_test extends \advanced_testcase {
* @param bool $value The setting's value.
* @param bool $expected The expected result.
*/
public function test_is_automatic_request_approval_on($setting, $type, $value, $expected) {
public function test_is_automatic_request_approval_on($setting, $type, $value, $expected): void {
$this->resetAfterTest();
if ($value !== null) {
@ -2713,7 +2713,7 @@ class api_test extends \advanced_testcase {
/**
* Test api validate_create_data_request.
*/
public function test_validate_create_data_request() {
public function test_validate_create_data_request(): void {
$this->resetAfterTest();
$systemcontext = \context_system::instance();

View File

@ -30,7 +30,7 @@ class data_registry_test extends \advanced_testcase {
*
* This test is not great because we only test a limited set of values. This is a fault of the underlying API.
*/
public function test_get_effective_context_value_invalid_element() {
public function test_get_effective_context_value_invalid_element(): void {
$this->expectException(\coding_exception::class);
data_registry::get_effective_context_value(\context_system::instance(), 'invalid');
}
@ -40,7 +40,7 @@ class data_registry_test extends \advanced_testcase {
*
* This test is not great because we only test a limited set of values. This is a fault of the underlying API.
*/
public function test_get_effective_contextlevel_value_invalid_element() {
public function test_get_effective_contextlevel_value_invalid_element(): void {
$this->expectException(\coding_exception::class);
data_registry::get_effective_contextlevel_value(\context_system::instance(), 'invalid');
}

View File

@ -93,7 +93,7 @@ class data_request_test extends data_privacy_testcase {
* @param bool $resettable
* @param bool $active
*/
public function test_pseudo_states_export(int $status, bool $resettable, bool $active) {
public function test_pseudo_states_export(int $status, bool $resettable, bool $active): void {
$uut = new \tool_dataprivacy\data_request();
$uut->set('status', $status);
$uut->set('type', api::DATAREQUEST_TYPE_EXPORT);
@ -110,7 +110,7 @@ class data_request_test extends data_privacy_testcase {
* @param bool $resettable
* @param bool $active
*/
public function test_pseudo_states_delete(int $status, bool $resettable, bool $active) {
public function test_pseudo_states_delete(int $status, bool $resettable, bool $active): void {
$uut = new \tool_dataprivacy\data_request();
$uut->set('status', $status);
$uut->set('type', api::DATAREQUEST_TYPE_DELETE);
@ -125,7 +125,7 @@ class data_request_test extends data_privacy_testcase {
* @dataProvider status_state_provider
* @param int $status
*/
public function test_can_reset_others($status) {
public function test_can_reset_others($status): void {
$uut = new \tool_dataprivacy\data_request();
$uut->set('status', $status);
$uut->set('type', api::DATAREQUEST_TYPE_OTHERS);
@ -155,7 +155,7 @@ class data_request_test extends data_privacy_testcase {
* @dataProvider non_resettable_provider
* @param int $status
*/
public function test_non_resubmit_request($status) {
public function test_non_resubmit_request($status): void {
$uut = new \tool_dataprivacy\data_request();
$uut->set('status', $status);
@ -168,7 +168,7 @@ class data_request_test extends data_privacy_testcase {
/**
* Ensure that a rejected request can be reset.
*/
public function test_resubmit_request() {
public function test_resubmit_request(): void {
$this->resetAfterTest();
$uut = new \tool_dataprivacy\data_request();
@ -192,7 +192,7 @@ class data_request_test extends data_privacy_testcase {
/**
* Ensure that an active request can be reset.
*/
public function test_resubmit_active_request() {
public function test_resubmit_active_request(): void {
$this->resetAfterTest();
$uut = new \tool_dataprivacy\data_request();

View File

@ -90,7 +90,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with no lastaccess is not flagged for deletion.
*/
public function test_flag_not_setup() {
public function test_flag_not_setup(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -111,7 +111,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with no lastaccess is not flagged for deletion.
*/
public function test_flag_user_no_lastaccess() {
public function test_flag_user_no_lastaccess(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -134,7 +134,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a recent lastaccess is not flagged for deletion.
*/
public function test_flag_user_recent_lastaccess() {
public function test_flag_user_recent_lastaccess(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -157,7 +157,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past is flagged for deletion.
*/
public function test_flag_user_past_lastaccess() {
public function test_flag_user_past_lastaccess(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -181,7 +181,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past but active enrolments is not flagged for deletion.
*/
public function test_flag_user_past_lastaccess_still_enrolled() {
public function test_flag_user_past_lastaccess_still_enrolled(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -209,7 +209,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past and no active enrolments is flagged for deletion.
*/
public function test_flag_user_update_existing() {
public function test_flag_user_update_existing(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'P5Y');
@ -241,7 +241,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past and expired enrolments.
*/
public function test_flag_user_past_lastaccess_unexpired_past_enrolment() {
public function test_flag_user_past_lastaccess_unexpired_past_enrolment(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'P1Y');
@ -269,7 +269,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past and expired enrolments.
*/
public function test_flag_user_past_override_role() {
public function test_flag_user_past_override_role(): void {
global $DB;
$this->resetAfterTest();
@ -303,7 +303,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past and expired enrolments.
*/
public function test_flag_user_past_lastaccess_expired_enrolled() {
public function test_flag_user_past_lastaccess_expired_enrolled(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -332,7 +332,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a user with a lastaccess in the past and enrolments without a course end date are respected
* correctly.
*/
public function test_flag_user_past_lastaccess_missing_enddate_required() {
public function test_flag_user_past_lastaccess_missing_enddate_required(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -364,7 +364,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a user with a lastaccess in the past and enrolments without a course end date are respected
* correctly when the end date is not required.
*/
public function test_flag_user_past_lastaccess_missing_enddate_not_required() {
public function test_flag_user_past_lastaccess_missing_enddate_not_required(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -395,7 +395,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a recent lastaccess is not flagged for deletion.
*/
public function test_flag_user_recent_lastaccess_existing_record() {
public function test_flag_user_recent_lastaccess_existing_record(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -429,7 +429,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a recent lastaccess is not flagged for deletion.
*/
public function test_flag_user_retention_changed() {
public function test_flag_user_retention_changed(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -469,7 +469,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a historically expired expired block record child is cleaned up.
*/
public function test_flag_user_historic_block_unapproved() {
public function test_flag_user_historic_block_unapproved(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -506,7 +506,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a block which has a default retention period which has not expired, is still expired.
*/
public function test_flag_user_historic_unexpired_child() {
public function test_flag_user_historic_unexpired_child(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -534,7 +534,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with no end date is not flagged.
*/
public function test_flag_course_no_enddate() {
public function test_flag_course_no_enddate(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -553,7 +553,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past, but a child which is unexpired is not flagged.
*/
public function test_flag_course_past_enddate_future_child() {
public function test_flag_course_past_enddate_future_child(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'P5Y');
@ -575,7 +575,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past is flagged.
*/
public function test_flag_course_past_enddate() {
public function test_flag_course_past_enddate(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -597,7 +597,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past is flagged.
*/
public function test_flag_course_past_enddate_multiple() {
public function test_flag_course_past_enddate_multiple(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -625,7 +625,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the future is not flagged.
*/
public function test_flag_course_future_enddate() {
public function test_flag_course_future_enddate(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -644,7 +644,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the future is not flagged.
*/
public function test_flag_course_recent_unexpired_enddate() {
public function test_flag_course_recent_unexpired_enddate(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -662,7 +662,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past is flagged, taking into account any purpose override
*/
public function test_flag_course_past_enddate_with_override_unexpired_role() {
public function test_flag_course_past_enddate_with_override_unexpired_role(): void {
global $DB;
$this->resetAfterTest();
@ -701,7 +701,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past is flagged, and any expired role is ignored.
*/
public function test_flag_course_past_enddate_with_override_expired_role() {
public function test_flag_course_past_enddate_with_override_expired_role(): void {
global $DB;
$this->resetAfterTest();
@ -740,7 +740,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that where a course has explicitly expired one role, but that role is explicitly not expired in a child
* context, does not have the parent context role expired.
*/
public function test_flag_course_override_expiredwith_override_unexpired_on_child() {
public function test_flag_course_override_expiredwith_override_unexpired_on_child(): void {
global $DB;
$this->resetAfterTest();
@ -809,7 +809,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user context previously flagged as approved is not removed if the user has any unexpired roles.
*/
public function test_process_user_context_with_override_unexpired_role() {
public function test_process_user_context_with_override_unexpired_role(): void {
global $DB;
$this->resetAfterTest();
@ -867,7 +867,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a module context previously flagged as approved is removed with appropriate unexpiredroles kept.
*/
public function test_process_course_context_with_override_unexpired_role() {
public function test_process_course_context_with_override_unexpired_role(): void {
global $DB;
$this->resetAfterTest();
@ -955,7 +955,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a module context previously flagged as approved is removed with appropriate expiredroles kept.
*/
public function test_process_course_context_with_override_expired_role() {
public function test_process_course_context_with_override_expired_role(): void {
global $DB;
$this->resetAfterTest();
@ -1043,7 +1043,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a module context previously flagged as approved is removed with appropriate expiredroles kept.
*/
public function test_process_course_context_with_user_in_both_lists() {
public function test_process_course_context_with_user_in_both_lists(): void {
global $DB;
$this->resetAfterTest();
@ -1132,7 +1132,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a module context previously flagged as approved is removed with appropriate expiredroles kept.
*/
public function test_process_course_context_with_user_in_both_lists_expired() {
public function test_process_course_context_with_user_in_both_lists_expired(): void {
global $DB;
$this->resetAfterTest();
@ -1228,7 +1228,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a site not setup will not process anything.
*/
public function test_process_not_setup() {
public function test_process_not_setup(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user(['lastaccess' => time() - YEARSECS]);
@ -1265,7 +1265,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with no lastaccess is not flagged for deletion.
*/
public function test_process_none_approved() {
public function test_process_none_approved(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -1304,7 +1304,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with no lastaccess is not flagged for deletion.
*/
public function test_process_no_context() {
public function test_process_no_context(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -1343,7 +1343,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user context previously flagged as approved is removed.
*/
public function test_process_user_context() {
public function test_process_user_context(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -1405,7 +1405,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course context previously flagged as approved is removed.
*/
public function test_process_course_context() {
public function test_process_course_context(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -1450,7 +1450,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user context previously flagged as approved is not removed if the user then logs in.
*/
public function test_process_user_context_logged_in_after_approval() {
public function test_process_user_context_logged_in_after_approval(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -1502,7 +1502,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user context previously flagged as approved is not removed if the purpose has changed.
*/
public function test_process_user_context_changed_after_approved() {
public function test_process_user_context_changed_after_approved(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -1554,7 +1554,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a historically expired expired block record child is cleaned up.
*/
public function test_process_user_historic_block_unapproved() {
public function test_process_user_historic_block_unapproved(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -1613,7 +1613,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a block which has a default retention period which has not expired, is still expired.
*/
public function test_process_user_historic_unexpired_child() {
public function test_process_user_historic_unexpired_child(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@ -1667,7 +1667,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a course context previously flagged as approved for deletion which now has an unflagged child, is
* updated.
*/
public function test_process_course_context_updated() {
public function test_process_course_context_updated(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -1718,7 +1718,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a course context previously flagged as approved for deletion which now has an unflagged child, is
* updated.
*/
public function test_process_course_context_outstanding_children() {
public function test_process_course_context_outstanding_children(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -1767,7 +1767,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a course context previously flagged as approved for deletion which now has an unflagged child, is
* updated.
*/
public function test_process_course_context_pending_children() {
public function test_process_course_context_pending_children(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -1825,7 +1825,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a course context previously flagged as approved for deletion which now has an unflagged child, is
* updated.
*/
public function test_process_course_context_approved_children() {
public function test_process_course_context_approved_children(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -1903,7 +1903,7 @@ class expired_contexts_test extends \advanced_testcase {
* @param int $status
* @param bool $expected
*/
public function test_can_process_deletion($status, $expected) {
public function test_can_process_deletion($status, $expected): void {
$purpose = new expired_context(0, (object) [
'status' => $status,
@ -1942,7 +1942,7 @@ class expired_contexts_test extends \advanced_testcase {
* @param int $status
* @param bool $expected
*/
public function test_is_complete($status, $expected) {
public function test_is_complete($status, $expected): void {
$purpose = new expired_context(0, (object) [
'status' => $status,
'contextid' => \context_system::instance()->id,
@ -1980,7 +1980,7 @@ class expired_contexts_test extends \advanced_testcase {
* @param array $record
* @param bool $expected
*/
public function test_is_fully_expired($record, $expected) {
public function test_is_fully_expired($record, $expected): void {
$purpose = new expired_context(0, (object) $record);
$this->assertEquals($expected, $purpose->is_fully_expired());
@ -2022,7 +2022,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that any orphaned records are removed once the context has been removed.
*/
public function test_orphaned_records_are_cleared() {
public function test_orphaned_records_are_cleared(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@ -2073,7 +2073,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that the progres tracer works as expected out of the box.
*/
public function test_progress_tracer_default() {
public function test_progress_tracer_default(): void {
$manager = new \tool_dataprivacy\expired_contexts_manager();
$rc = new \ReflectionClass(\tool_dataprivacy\expired_contexts_manager::class);
@ -2085,7 +2085,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that the progres tracer works as expected when given a specific traer.
*/
public function test_progress_tracer_set() {
public function test_progress_tracer_set(): void {
$manager = new \tool_dataprivacy\expired_contexts_manager();
$mytrace = new \null_progress_trace();
$manager->set_progress($mytrace);
@ -2164,7 +2164,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with the system context.
*/
public function test_is_context_expired_system() {
public function test_is_context_expired_system(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'P1D');
$user = $this->getDataGenerator()->create_user(['lastaccess' => time() - YEARSECS]);
@ -2180,7 +2180,7 @@ class expired_contexts_test extends \advanced_testcase {
* Children of a user context always follow the user expiry rather than any context level defaults (e.g. at the
* block level.
*/
public function test_is_context_expired_user_block() {
public function test_is_context_expired_user_block(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D');
@ -2205,7 +2205,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with the front page course.
*/
public function test_is_context_expired_frontpage() {
public function test_is_context_expired_frontpage(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D');
@ -2239,7 +2239,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an expired course.
*/
public function test_is_context_expired_course_expired() {
public function test_is_context_expired_course_expired(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D');
@ -2262,7 +2262,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an unexpired course.
*/
public function test_is_context_expired_course_unexpired() {
public function test_is_context_expired_course_unexpired(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D');
@ -2291,7 +2291,7 @@ class expired_contexts_test extends \advanced_testcase {
* If the course is still within the expiry period for the child context, then that child's protected flag should be
* respected, even when the course may have expired.
*/
public function test_is_child_context_expired_course_unexpired_with_child() {
public function test_is_child_context_expired_course_unexpired_with_child(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D', 'P1D');
@ -2321,7 +2321,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an expired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override() {
public function test_is_context_expired_course_expired_override(): void {
global $DB;
$this->resetAfterTest();
@ -2356,7 +2356,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an expired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override_parent() {
public function test_is_context_expired_course_expired_override_parent(): void {
global $DB;
$this->resetAfterTest();
@ -2405,7 +2405,7 @@ class expired_contexts_test extends \advanced_testcase {
* Test the is_context_expired functions when supplied with an expired course which has role overrides but the user
* does not hold the role.
*/
public function test_is_context_expired_course_expired_override_parent_no_role() {
public function test_is_context_expired_course_expired_override_parent_no_role(): void {
global $DB;
$this->resetAfterTest();
@ -2434,7 +2434,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an unexpired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override_inverse() {
public function test_is_context_expired_course_expired_override_inverse(): void {
global $DB;
$this->resetAfterTest();
@ -2463,7 +2463,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an unexpired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override_inverse_parent() {
public function test_is_context_expired_course_expired_override_inverse_parent(): void {
global $DB;
$this->resetAfterTest();
@ -2496,7 +2496,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an unexpired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override_inverse_parent_not_assigned() {
public function test_is_context_expired_course_expired_override_inverse_parent_not_assigned(): void {
global $DB;
$this->resetAfterTest();
@ -2528,7 +2528,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that context expired checks for a specific user taken into account roles.
*/
public function test_is_context_expired_or_unprotected_for_user_role_mixtures_protected() {
public function test_is_context_expired_or_unprotected_for_user_role_mixtures_protected(): void {
global $DB;
$this->resetAfterTest();
@ -2583,7 +2583,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that context expired checks for a specific user taken into account roles when retention is inversed.
*/
public function test_is_context_expired_or_unprotected_for_user_role_mixtures_protected_inverse() {
public function test_is_context_expired_or_unprotected_for_user_role_mixtures_protected_inverse(): void {
global $DB;
$this->resetAfterTest();

View File

@ -41,7 +41,7 @@ class expired_data_requests_test extends data_privacy_testcase {
/**
* Test finding and deleting expired data requests
*/
public function test_data_request_expiry() {
public function test_data_request_expiry(): void {
global $DB;
$this->resetAfterTest();
\core_privacy\local\request\writer::setup_real_writer_instance();
@ -112,7 +112,7 @@ class expired_data_requests_test extends data_privacy_testcase {
* Tests for the expected request status to protect from false positive/negative,
* then tests is_expired() is returning the expected response.
*/
public function test_is_expired() {
public function test_is_expired(): void {
$this->resetAfterTest();
\core_privacy\local\request\writer::setup_real_writer_instance();

View File

@ -48,7 +48,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request() with the user not logged in.
*/
public function test_approve_data_request_not_logged_in() {
public function test_approve_data_request_not_logged_in(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -69,7 +69,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request() with the user not having a DPO role.
*/
public function test_approve_data_request_not_dpo() {
public function test_approve_data_request_not_dpo(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -89,7 +89,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request() for request that's not ready for approval
*/
public function test_approve_data_request_not_waiting_for_approval() {
public function test_approve_data_request_not_waiting_for_approval(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -110,7 +110,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request()
*/
public function test_approve_data_request() {
public function test_approve_data_request(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -133,7 +133,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request() for a non-existent request ID.
*/
public function test_approve_data_request_non_existent() {
public function test_approve_data_request_non_existent(): void {
$this->resetAfterTest();
// Admin as DPO. (The default when no one's assigned as a DPO in the site).
@ -151,7 +151,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::cancel_data_request() of another user.
*/
public function test_cancel_data_request_other_user() {
public function test_cancel_data_request_other_user(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -177,7 +177,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test cancellation of a request where you are the requester of another user's data.
*/
public function test_cancel_data_request_other_user_as_requester() {
public function test_cancel_data_request_other_user_as_requester(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -204,7 +204,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test cancellation of a request where you are the requester of another user's data.
*/
public function test_cancel_data_request_requester_lost_permissions() {
public function test_cancel_data_request_requester_lost_permissions(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -233,7 +233,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test cancellation of a request where you are the requester of another user's data.
*/
public function test_cancel_data_request_other_user_as_child() {
public function test_cancel_data_request_other_user_as_child(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -260,7 +260,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::cancel_data_request()
*/
public function test_cancel_data_request() {
public function test_cancel_data_request(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -283,7 +283,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test contact DPO.
*/
public function test_contact_dpo() {
public function test_contact_dpo(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -300,7 +300,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test contact DPO with message containing invalid input.
*/
public function test_contact_dpo_with_nasty_input() {
public function test_contact_dpo_with_nasty_input(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -314,7 +314,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request() with the user not logged in.
*/
public function test_deny_data_request_not_logged_in() {
public function test_deny_data_request_not_logged_in(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -334,7 +334,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request() with the user not having a DPO role.
*/
public function test_deny_data_request_not_dpo() {
public function test_deny_data_request_not_dpo(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -353,7 +353,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request() for request that's not ready for approval
*/
public function test_deny_data_request_not_waiting_for_approval() {
public function test_deny_data_request_not_waiting_for_approval(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -373,7 +373,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request()
*/
public function test_deny_data_request() {
public function test_deny_data_request(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -395,7 +395,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request() for a non-existent request ID.
*/
public function test_deny_data_request_non_existent() {
public function test_deny_data_request_non_existent(): void {
$this->resetAfterTest();
// Admin as DPO. (The default when no one's assigned as a DPO in the site).
@ -412,7 +412,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_request() with the user not logged in.
*/
public function test_get_data_request_not_logged_in() {
public function test_get_data_request_not_logged_in(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -430,7 +430,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_request() with the user not having a DPO role.
*/
public function test_get_data_request_not_dpo() {
public function test_get_data_request_not_dpo(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -450,7 +450,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_request()
*/
public function test_get_data_request() {
public function test_get_data_request(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@ -475,7 +475,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_request() for a non-existent request ID.
*/
public function test_get_data_request_non_existent() {
public function test_get_data_request_non_existent(): void {
$this->resetAfterTest();
// Admin as DPO. (The default when no one's assigned as a DPO in the site).
@ -488,7 +488,7 @@ class external_test extends externallib_advanced_testcase {
* Test for \tool_dataprivacy\external::set_context_defaults()
* when called by a user that doesn't have the manage registry capability.
*/
public function test_set_context_defaults_no_capability() {
public function test_set_context_defaults_no_capability(): void {
$this->resetAfterTest();
$generator = $this->getDataGenerator();
@ -508,7 +508,7 @@ class external_test extends externallib_advanced_testcase {
* @param bool $modulelevel Whether defaults are to be applied on the module context level or for an activity only.
* @param bool $override Whether to override instances.
*/
public function test_set_context_defaults($modulelevel, $override) {
public function test_set_context_defaults($modulelevel, $override): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -567,7 +567,7 @@ class external_test extends externallib_advanced_testcase {
* Test for \tool_dataprivacy\external::get_category_options()
* when called by a user that doesn't have the manage registry capability.
*/
public function test_get_category_options_no_capability() {
public function test_get_category_options_no_capability(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -596,7 +596,7 @@ class external_test extends externallib_advanced_testcase {
* @param bool $includeinherit Whether "Inherit" would be included to the options.
* @param bool $includenotset Whether "Not set" would be included to the options.
*/
public function test_get_category_options($includeinherit, $includenotset) {
public function test_get_category_options($includeinherit, $includenotset): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -642,7 +642,7 @@ class external_test extends externallib_advanced_testcase {
* Test for \tool_dataprivacy\external::get_purpose_options()
* when called by a user that doesn't have the manage registry capability.
*/
public function test_get_purpose_options_no_capability() {
public function test_get_purpose_options_no_capability(): void {
$this->resetAfterTest();
$generator = $this->getDataGenerator();
$user = $generator->create_user();
@ -658,7 +658,7 @@ class external_test extends externallib_advanced_testcase {
* @param bool $includeinherit Whether "Inherit" would be included to the options.
* @param bool $includenotset Whether "Not set" would be included to the options.
*/
public function test_get_purpose_options($includeinherit, $includenotset) {
public function test_get_purpose_options($includeinherit, $includenotset): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -726,7 +726,7 @@ class external_test extends externallib_advanced_testcase {
* @param bool $inheritpurpose Whether the purpose would be set to "Inherit".
* @param bool $nodefaults Whether to fetch only activities that don't have defaults.
*/
public function test_get_activity_options($inheritcategory, $inheritpurpose, $nodefaults) {
public function test_get_activity_options($inheritcategory, $inheritpurpose, $nodefaults): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -774,7 +774,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_approve_data_requests().
*/
public function test_bulk_approve_data_requests() {
public function test_bulk_approve_data_requests(): void {
$this->resetAfterTest();
// Create delete data requests.
@ -802,7 +802,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_approve_data_requests() for a non-existent request ID.
*/
public function test_bulk_approve_data_requests_non_existent() {
public function test_bulk_approve_data_requests_non_existent(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -820,7 +820,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a user without permission to deny requests.
*/
public function test_bulk_approve_data_requests_no_permission() {
public function test_bulk_approve_data_requests_no_permission(): void {
$this->resetAfterTest();
// Create delete data requests.
@ -849,7 +849,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a user without permission to deny requests.
*/
public function test_bulk_approve_data_requests_own_request() {
public function test_bulk_approve_data_requests_own_request(): void {
$this->resetAfterTest();
// Create delete data requests.
@ -877,7 +877,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests().
*/
public function test_bulk_deny_data_requests() {
public function test_bulk_deny_data_requests(): void {
$this->resetAfterTest();
// Create delete data requests.
@ -905,7 +905,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a non-existent request ID.
*/
public function test_bulk_deny_data_requests_non_existent() {
public function test_bulk_deny_data_requests_non_existent(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -922,7 +922,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a user without permission to deny requests.
*/
public function test_bulk_deny_data_requests_no_permission() {
public function test_bulk_deny_data_requests_no_permission(): void {
$this->resetAfterTest();
// Create delete data requests.
@ -951,7 +951,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a user cannot approve their own request.
*/
public function test_bulk_deny_data_requests_own_request() {
public function test_bulk_deny_data_requests_own_request(): void {
$this->resetAfterTest();
// Create delete data requests.
@ -986,7 +986,7 @@ class external_test extends externallib_advanced_testcase {
* @throws required_capability_exception
* @throws restricted_context_exception
*/
public function test_get_users_using_using_non_identity() {
public function test_get_users_using_using_non_identity(): void {
$this->resetAfterTest();
$context = \context_system::instance();
$requester = $this->getDataGenerator()->create_user();
@ -1021,7 +1021,7 @@ class external_test extends externallib_advanced_testcase {
* @throws required_capability_exception
* @throws restricted_context_exception
*/
public function test_get_users_using_identity_without_permission() {
public function test_get_users_using_identity_without_permission(): void {
global $CFG;
$this->resetAfterTest();
@ -1053,7 +1053,7 @@ class external_test extends externallib_advanced_testcase {
* @throws required_capability_exception
* @throws restricted_context_exception
*/
public function test_get_users_using_field_not_in_identity() {
public function test_get_users_using_field_not_in_identity(): void {
$this->resetAfterTest();
$context = \context_system::instance();
@ -1082,7 +1082,7 @@ class external_test extends externallib_advanced_testcase {
* @throws required_capability_exception
* @throws restricted_context_exception
*/
public function test_get_users() {
public function test_get_users(): void {
global $CFG;
$this->resetAfterTest();
$CFG->showuseridentity = 'institution';
@ -1118,7 +1118,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_access_information().
*/
public function test_get_access_information() {
public function test_get_access_information(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -1145,7 +1145,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::create_data_request()
*/
public function test_create_data_request() {
public function test_create_data_request(): void {
$this->resetAfterTest();
$systemcontext = \context_system::instance();
@ -1200,7 +1200,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::create_data_request() when no dpo available.
*/
public function test_create_data_request_no_dpo() {
public function test_create_data_request_no_dpo(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -1214,7 +1214,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::create_data_request() with missing permission.
*/
public function test_create_data_request_no_permission() {
public function test_create_data_request_no_permission(): void {
$this->resetAfterTest();
// Enable contact DPO.
@ -1231,7 +1231,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::create_data_request() with invalid request type.
*/
public function test_create_data_request_invalid_type() {
public function test_create_data_request_invalid_type(): void {
$this->resetAfterTest();
// Enable contact DPO.
@ -1248,7 +1248,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_requests().
*/
public function test_get_data_requests() {
public function test_get_data_requests(): void {
global $DB;
$this->resetAfterTest();
@ -1355,7 +1355,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_requests() invalid user id.
*/
public function test_get_data_requests_invalid_userid() {
public function test_get_data_requests_invalid_userid(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -43,7 +43,7 @@ class submit_selected_courses_form_test extends \externallib_advanced_testcase {
/**
* Test for submit_selected_courses_form().
*/
public function test_submit_selected_courses_form() {
public function test_submit_selected_courses_form(): void {
global $DB;
$this->resetAfterTest();

View File

@ -33,7 +33,7 @@ class filtered_userlist_test extends \advanced_testcase {
* @param array $unexpired The set of userids considered as unexpired.
* @param array $expected The expected values.
*/
public function test_apply_expired_contexts_filters(array $initial, array $expired, array $unexpired, array $expected) {
public function test_apply_expired_contexts_filters(array $initial, array $expired, array $unexpired, array $expected): void {
$userlist = $this->getMockBuilder(\tool_dataprivacy\filtered_userlist::class)
->disableOriginalConstructor()
->onlyMethods([])

View File

@ -32,7 +32,7 @@ class manager_observer_test extends data_privacy_testcase {
/**
* Ensure that when users are configured as DPO, they are sent an message upon failure.
*/
public function test_handle_component_failure() {
public function test_handle_component_failure(): void {
$this->resetAfterTest();
// Create another user who is not a DPO.
@ -65,7 +65,7 @@ class manager_observer_test extends data_privacy_testcase {
/**
* Ensure that when no user is configured as DPO, the message is sent to admin instead.
*/
public function test_handle_component_failure_no_dpo() {
public function test_handle_component_failure_no_dpo(): void {
$this->resetAfterTest();
// Create another user who is not a DPO or admin.

View File

@ -47,7 +47,7 @@ class metadata_registry_test extends \advanced_testcase {
/**
* Test that we can fetch metadata about users for the whole system and that it matches the system count.
*/
public function test_get_registry_metadata_count() {
public function test_get_registry_metadata_count(): void {
$data = $this->get_meta_data();
$plugintypes = \core_component::get_plugin_types();
@ -71,7 +71,7 @@ class metadata_registry_test extends \advanced_testcase {
/**
* Check that the expected null provider information is returned.
*/
public function test_get_registry_metadata_null_provider_details() {
public function test_get_registry_metadata_null_provider_details(): void {
$data = $this->get_meta_data();
// Check details of core privacy (a null privder) are correct.
@ -83,7 +83,7 @@ class metadata_registry_test extends \advanced_testcase {
/**
* Check that the expected privacy provider information is returned.
*/
public function test_get_registry_metadata_provider_details() {
public function test_get_registry_metadata_provider_details(): void {
$data = $this->get_meta_data();
// Check details of core rating (a normal provider) are correct.

View File

@ -46,7 +46,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -65,7 +65,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -82,7 +82,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_get_users_in_context_non_user_context() {
public function test_get_users_in_context_non_user_context(): void {
$context = \context_system::instance();
$userlist = new userlist($context, 'tool_dataprivacy');
@ -96,7 +96,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_export_user_data() {
public function test_export_user_data(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@ -152,7 +152,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_export_user_preferences() {
public function test_export_user_preferences(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();

View File

@ -45,7 +45,7 @@ class task_test extends \data_privacy_testcase {
* is created when there are not any existing data requests
* for that particular user.
*/
public function test_delete_existing_deleted_users_task_no_previous_requests() {
public function test_delete_existing_deleted_users_task_no_previous_requests(): void {
global $DB;
$this->resetAfterTest();
@ -74,7 +74,7 @@ class task_test extends \data_privacy_testcase {
* Ensure that a delete data request for pre-existing deleted users
* is not being created when automatic creation of delete data requests is disabled.
*/
public function test_delete_existing_deleted_users_task_automatic_creation_disabled() {
public function test_delete_existing_deleted_users_task_automatic_creation_disabled(): void {
global $DB;
$this->resetAfterTest();
@ -104,7 +104,7 @@ class task_test extends \data_privacy_testcase {
* is created when there are existing non-delete data requests
* for that particular user.
*/
public function test_delete_existing_deleted_users_task_existing_export_data_requests() {
public function test_delete_existing_deleted_users_task_existing_export_data_requests(): void {
global $DB;
$this->resetAfterTest();
@ -139,7 +139,7 @@ class task_test extends \data_privacy_testcase {
* is not created when there are existing ongoing delete data requests
* for that particular user.
*/
public function test_delete_existing_deleted_users_task_existing_ongoing_delete_data_requests() {
public function test_delete_existing_deleted_users_task_existing_ongoing_delete_data_requests(): void {
global $DB;
$this->resetAfterTest();
@ -179,7 +179,7 @@ class task_test extends \data_privacy_testcase {
* is not created when there are existing finished delete data requests
* for that particular user.
*/
public function test_delete_existing_deleted_users_task_existing_finished_delete_data_requests() {
public function test_delete_existing_deleted_users_task_existing_finished_delete_data_requests(): void {
global $DB;
$this->resetAfterTest();

View File

@ -30,7 +30,7 @@ class user_deleted_observer_test extends \advanced_testcase {
/**
* Ensure that a delete data request is created upon user deletion.
*/
public function test_create_delete_data_request() {
public function test_create_delete_data_request(): void {
$this->resetAfterTest();
// Enable automatic creation of delete data requests.
@ -50,7 +50,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is not created upon user deletion if automatic creation of
* delete data requests is disabled.
*/
public function test_create_delete_data_request_automatic_creation_disabled() {
public function test_create_delete_data_request_automatic_creation_disabled(): void {
$this->resetAfterTest();
// Disable automatic creation of delete data requests.
@ -70,7 +70,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is being created upon user deletion
* if an ongoing export data request (or any other except delete data request) for that user already exists.
*/
public function test_create_delete_data_request_export_data_request_preexists() {
public function test_create_delete_data_request_export_data_request_preexists(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -96,7 +96,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is not being created upon user deletion
* if an ongoing delete data request for that user already exists.
*/
public function test_create_delete_data_request_ongoing_delete_data_request_preexists() {
public function test_create_delete_data_request_ongoing_delete_data_request_preexists(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -121,7 +121,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is being created upon user deletion
* if a finished delete data request (excluding complete) for that user already exists.
*/
public function test_create_delete_data_request_canceled_delete_data_request_preexists() {
public function test_create_delete_data_request_canceled_delete_data_request_preexists(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -151,7 +151,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is being created upon user deletion
* if a completed delete data request for that user already exists.
*/
public function test_create_delete_data_request_completed_delete_data_request_preexists() {
public function test_create_delete_data_request_completed_delete_data_request_preexists(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -30,7 +30,7 @@ class tool_filetypes_test extends advanced_testcase {
*
* @covers ::is_extension_invalid
*/
public function test_is_extension_invalid() {
public function test_is_extension_invalid(): void {
// The pdf file extension already exists in default moodle minetypes.
$this->assertTrue(utils::is_extension_invalid('pdf'));
@ -52,7 +52,7 @@ class tool_filetypes_test extends advanced_testcase {
*
* @covers ::is_defaulticon_allowed
*/
public function test_is_defaulticon_allowed() {
public function test_is_defaulticon_allowed(): void {
// You ARE allowed to set a default icon for a MIME type that hasn't
// been used yet.
$this->assertTrue(utils::is_defaulticon_allowed('application/x-frog'));
@ -71,7 +71,7 @@ class tool_filetypes_test extends advanced_testcase {
*
* @covers ::get_icons_from_path
*/
public function test_get_icons_from_path() {
public function test_get_icons_from_path(): void {
// Get icons from the fixtures folder.
$icons = utils::get_icons_from_path(__DIR__ . '/fixtures');
@ -86,7 +86,7 @@ class tool_filetypes_test extends advanced_testcase {
*
* @covers ::get_file_icons
*/
public function test_get_file_icons() {
public function test_get_file_icons(): void {
$icons = utils::get_file_icons();
$filetypes = core_filetypes::get_types();

View File

@ -30,7 +30,7 @@ class maketestcourse_test extends \advanced_testcase {
/**
* Creates a small test course and checks all the components have been put in place.
*/
public function test_make_xs_course() {
public function test_make_xs_course(): void {
global $DB;
$this->resetAfterTest();
@ -137,7 +137,7 @@ class maketestcourse_test extends \advanced_testcase {
/**
* Creates an small test course with fixed data set and checks the used sections and users.
*/
public function test_fixed_data_set() {
public function test_fixed_data_set(): void {
$this->resetAfterTest();
$this->setAdminUser();
@ -178,7 +178,7 @@ class maketestcourse_test extends \advanced_testcase {
/**
* Creates a small test course specifying a maximum size and checks the generated files size is limited.
*/
public function test_filesize_limit() {
public function test_filesize_limit(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -40,7 +40,7 @@ class maketestsite_test extends \advanced_testcase {
/**
* Checks that site courses shortnames are properly generated.
*/
public function test_shortnames_generation() {
public function test_shortnames_generation(): void {
$this->resetAfterTest();
$this->setAdminUser();

View File

@ -138,7 +138,7 @@ class httpsreplace_test extends \advanced_testcase {
* @param string $expectedcontent What content we are expecting afterwards.
* @dataProvider upgrade_http_links_provider
*/
public function test_upgrade_http_links($content, $ouputregex, $expectedcontent) {
public function test_upgrade_http_links($content, $ouputregex, $expectedcontent): void {
global $DB;
$this->resetAfterTest();
@ -212,7 +212,7 @@ class httpsreplace_test extends \advanced_testcase {
* @param string $expectedcount Number of urls from that domain that we expect to be replaced.
* @dataProvider http_link_stats_provider
*/
public function test_http_link_stats($content, $domain, $expectedcount) {
public function test_http_link_stats($content, $domain, $expectedcount): void {
$this->resetAfterTest();
$finder = new tool_httpreplace_url_finder_mock();
@ -230,7 +230,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* Test links and text are not changed
*/
public function test_links_and_text() {
public function test_links_and_text(): void {
global $DB;
$this->resetAfterTest();
@ -261,7 +261,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* If we have an http wwwroot then we shouldn't report it.
*/
public function test_httpwwwroot() {
public function test_httpwwwroot(): void {
global $DB, $CFG;
$this->resetAfterTest();
@ -286,7 +286,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* Test that links in excluded tables are not replaced
*/
public function test_upgrade_http_links_excluded_tables() {
public function test_upgrade_http_links_excluded_tables(): void {
$this->resetAfterTest();
set_config('test_upgrade_http_links', '<img src="http://somesite/someimage.png" />');
@ -306,7 +306,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* Test renamed domains
*/
public function test_renames() {
public function test_renames(): void {
global $DB, $CFG;
$this->resetAfterTest();
$this->expectOutputRegex('/UPDATE/');
@ -339,7 +339,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* When there are many different pieces of contents from the same site, we should only run replace once
*/
public function test_multiple() {
public function test_multiple(): void {
global $DB;
$this->resetAfterTest();
$original1 = '';
@ -376,7 +376,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* Test the tool when the column name is a reserved word in SQL (in this case 'where')
*/
public function test_reserved_words() {
public function test_reserved_words(): void {
global $DB;
$this->resetAfterTest();

View File

@ -35,7 +35,7 @@ require_once(__DIR__.'/fixtures/testable_installer.php');
*/
class installer_test extends \advanced_testcase {
public function test_get_addons_repository_url() {
public function test_get_addons_repository_url(): void {
$installer = testable_tool_installaddon_installer::instance();
$url = $installer->get_addons_repository_url();
$query = parse_url($url, PHP_URL_QUERY);
@ -49,7 +49,7 @@ class installer_test extends \advanced_testcase {
$this->assertSame("2.5'; DROP TABLE mdl_user; --", $site['majorversion']);
}
public function test_decode_remote_request() {
public function test_decode_remote_request(): void {
$installer = testable_tool_installaddon_installer::instance();
$request = base64_encode(json_encode(array(
@ -107,7 +107,7 @@ class installer_test extends \advanced_testcase {
$this->assertSame(false, $installer->testable_decode_remote_request($request));
}
public function test_detect_plugin_component() {
public function test_detect_plugin_component(): void {
global $CFG;
$installer = tool_installaddon_installer::instance();
@ -119,7 +119,7 @@ class installer_test extends \advanced_testcase {
$this->assertFalse($installer->detect_plugin_component($zipfile));
}
public function test_detect_plugin_component_from_versionphp() {
public function test_detect_plugin_component_from_versionphp(): void {
global $CFG;
$installer = testable_tool_installaddon_installer::instance();
@ -136,7 +136,7 @@ $plugin->version = 2014121300;
$this->assertFalse($installer->testable_detect_plugin_component_from_versionphp($versionphp));
}
public function test_make_installfromzip_storage() {
public function test_make_installfromzip_storage(): void {
$installer = testable_tool_installaddon_installer::instance();
// Check we get writable directory.

View File

@ -41,7 +41,7 @@ class events_test extends \advanced_testcase {
$this->resetAfterTest();
}
public function test_langpack_updated() {
public function test_langpack_updated(): void {
global $CFG;
$event = \tool_langimport\event\langpack_updated::event_with_langcode($CFG->lang);
@ -56,14 +56,14 @@ class events_test extends \advanced_testcase {
$this->assertEquals(\context_system::instance(), $event->get_context());
}
public function test_langpack_updated_validation() {
public function test_langpack_updated_validation(): void {
$this->expectException('coding_exception');
$this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");
\tool_langimport\event\langpack_updated::event_with_langcode('broken langcode');
}
public function test_langpack_installed() {
public function test_langpack_installed(): void {
$event = \tool_langimport\event\langpack_imported::event_with_langcode('fr');
// Trigger and capture the event.
@ -76,14 +76,14 @@ class events_test extends \advanced_testcase {
$this->assertEquals(\context_system::instance(), $event->get_context());
}
public function test_langpack_installed_validation() {
public function test_langpack_installed_validation(): void {
$this->expectException('coding_exception');
$this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");
\tool_langimport\event\langpack_imported::event_with_langcode('broken langcode');
}
public function test_langpack_removed() {
public function test_langpack_removed(): void {
$event = \tool_langimport\event\langpack_removed::event_with_langcode('fr');
// Trigger and capture the event.
@ -96,7 +96,7 @@ class events_test extends \advanced_testcase {
$this->assertEquals(\context_system::instance(), $event->get_context());
}
public function test_langpack_removed_validation() {
public function test_langpack_removed_validation(): void {
$this->expectException('coding_exception');
$this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");

View File

@ -32,7 +32,7 @@ class locale_test extends \advanced_testcase {
* @covers ::check_locale_availability
* @return void
*/
public function test_check_locale_availability() {
public function test_check_locale_availability(): void {
// Create a mock of set_locale() method to simulate :
// - first setlocale() call which backup current locale
// - second setlocale() call which try to set new 'es' locale
@ -79,7 +79,7 @@ class locale_test extends \advanced_testcase {
* @param string $set locale string to be set.
* @param string $ret expected results returned after setting the locale.
*/
public function test_set_locale(string $set, string $ret) {
public function test_set_locale(string $set, string $ret): void {
// Make set_locale() public.
$loc = new locale();
$rc = new \ReflectionClass(locale::class);

View File

@ -34,7 +34,7 @@ defined('MOODLE_INTERNAL') || die();
*/
class helper_test extends advanced_testcase {
public function test_convert_version_to_epoch() {
public function test_convert_version_to_epoch(): void {
$version = '2020010100';
$expected = strtotime(20200101);

View File

@ -41,7 +41,7 @@ class manager_test extends advanced_testcase {
/**
* Test editing a license.
*/
public function test_edit_existing_license() {
public function test_edit_existing_license(): void {
$this->resetAfterTest();
// Create initial custom license to edit.
@ -84,7 +84,7 @@ class manager_test extends advanced_testcase {
$this->assertSame(date('Ymd', $formdata['version']) . '00', $actual->version);
}
public function test_edit_license_not_exists() {
public function test_edit_license_not_exists(): void {
$manager = new \tool_licensemanager\manager();
// We're testing a private method, so we need to setup reflector magic.
@ -104,7 +104,7 @@ class manager_test extends advanced_testcase {
$method->invoke($manager, \tool_licensemanager\manager::ACTION_UPDATE, $formdata['shortname']);
}
public function test_edit_license_no_shortname() {
public function test_edit_license_no_shortname(): void {
$manager = new \tool_licensemanager\manager();
// We're testing a private method, so we need to setup reflector magic.
@ -126,7 +126,7 @@ class manager_test extends advanced_testcase {
/**
* Test creating a new license.
*/
public function test_edit_create_license() {
public function test_edit_create_license(): void {
$this->resetAfterTest();
$licensecount = count(license_manager::get_licenses());
@ -166,7 +166,7 @@ class manager_test extends advanced_testcase {
/**
* Test changing the order of licenses.
*/
public function test_change_license_order() {
public function test_change_license_order(): void {
$this->resetAfterTest();
$licenseorder = array_keys(license_manager::get_licenses());

View File

@ -95,7 +95,7 @@ class provider_test extends provider_testcase {
}
}
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
$admin = \core_user::get_user(2);
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -155,7 +155,7 @@ class provider_test extends provider_testcase {
/**
* Check that user IDs are returned for a given context.
*/
public function test_add_userids_for_context() {
public function test_add_userids_for_context(): void {
$admin = \core_user::get_user(2);
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -201,7 +201,7 @@ class provider_test extends provider_testcase {
$this->assertEmpty(array_diff($expectedresult, $userids));
}
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB;
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -242,7 +242,7 @@ class provider_test extends provider_testcase {
$this->assertEquals(2, $DB->count_records('logstore_standard_log', ['userid' => $u2->id]));
}
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB;
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -286,7 +286,7 @@ class provider_test extends provider_testcase {
/**
* Check that data is removed for the listed users in a given context.
*/
public function test_delete_data_for_userlist() {
public function test_delete_data_for_userlist(): void {
global $DB;
$u1 = $this->getDataGenerator()->create_user();
@ -328,7 +328,7 @@ class provider_test extends provider_testcase {
$this->assertEquals($u2->id, $currentrecord->userid);
}
public function test_export_data_for_user() {
public function test_export_data_for_user(): void {
$admin = \core_user::get_user(2);
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();

View File

@ -35,7 +35,7 @@ class store_test extends \advanced_testcase {
* @param bool $jsonformat True to test with JSON format
* @dataProvider log_writing_provider
*/
public function test_log_writing(bool $jsonformat) {
public function test_log_writing(bool $jsonformat): void {
global $DB, $CFG;
$this->resetAfterTest();
$this->preventResetByRollback(); // Logging waits till the transaction gets committed.
@ -263,7 +263,7 @@ class store_test extends \advanced_testcase {
/**
* Test method is_event_ignored.
*/
public function test_is_event_ignored() {
public function test_is_event_ignored(): void {
$this->resetAfterTest();
// Test guest filtering.
@ -306,7 +306,7 @@ class store_test extends \advanced_testcase {
/**
* Test logmanager::get_supported_reports returns all reports that require this store.
*/
public function test_get_supported_reports() {
public function test_get_supported_reports(): void {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');

View File

@ -53,7 +53,7 @@ class provider_test extends provider_testcase {
$this->preventResetByRollback(); // Logging waits till the transaction gets committed.
}
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
$admin = \core_user::get_user(2);
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -110,7 +110,7 @@ class provider_test extends provider_testcase {
$this->assert_contextlist_equals($this->get_contextlist_for_user($admin), [$sysctx, $c1ctx, $c2ctx]);
}
public function test_add_userids_for_context() {
public function test_add_userids_for_context(): void {
$admin = \core_user::get_user(2);
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -156,7 +156,7 @@ class provider_test extends provider_testcase {
$this->assertEmpty(array_diff($expectedresult, $userids));
}
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB;
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -197,7 +197,7 @@ class provider_test extends provider_testcase {
$this->assertEquals(2, $DB->count_records('logstore_standard_log', ['userid' => $u2->id]));
}
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB;
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -238,7 +238,7 @@ class provider_test extends provider_testcase {
$this->assertEquals(1, $DB->count_records('logstore_standard_log', ['userid' => $u2->id]));
}
public function test_delete_data_for_userlist() {
public function test_delete_data_for_userlist(): void {
global $DB;
$u1 = $this->getDataGenerator()->create_user();
@ -280,7 +280,7 @@ class provider_test extends provider_testcase {
$this->assertEquals($u2->id, $currentrecord->userid);
}
public function test_export_data_for_user() {
public function test_export_data_for_user(): void {
$admin = \core_user::get_user(2);
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();

View File

@ -40,7 +40,7 @@ class store_test extends \advanced_testcase {
* @param bool $jsonformat True to test with JSON format
* @dataProvider log_writing_provider
*/
public function test_log_writing(bool $jsonformat) {
public function test_log_writing(bool $jsonformat): void {
global $DB;
$this->resetAfterTest();
$this->preventResetByRollback(); // Logging waits till the transaction gets committed.
@ -238,7 +238,7 @@ class store_test extends \advanced_testcase {
/**
* Test logmanager::get_supported_reports returns all reports that require this store.
*/
public function test_get_supported_reports() {
public function test_get_supported_reports(): void {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
@ -261,7 +261,7 @@ class store_test extends \advanced_testcase {
/**
* Verify that gc disabling works
*/
public function test_gc_enabled_as_expected() {
public function test_gc_enabled_as_expected(): void {
if (!gc_enabled()) {
$this->markTestSkipped('Garbage collector (gc) is globally disabled.');
}
@ -275,7 +275,7 @@ class store_test extends \advanced_testcase {
* Test sql_reader::get_events_select_iterator.
* @return void
*/
public function test_events_traversable() {
public function test_events_traversable(): void {
global $DB;
$this->disable_gc();
@ -332,7 +332,7 @@ class store_test extends \advanced_testcase {
/**
* Test that the standard log cleanup works correctly.
*/
public function test_cleanup_task() {
public function test_cleanup_task(): void {
global $DB;
$this->resetAfterTest();
@ -372,12 +372,12 @@ class store_test extends \advanced_testcase {
* @param mixed $value Value to encode and decode
* @dataProvider decode_other_provider
*/
public function test_decode_other($value) {
public function test_decode_other($value): void {
$this->assertEquals($value, \logstore_standard\log\store::decode_other(serialize($value)));
$this->assertEquals($value, \logstore_standard\log\store::decode_other(json_encode($value)));
}
public function test_decode_other_with_wrongly_encoded_contents() {
public function test_decode_other_with_wrongly_encoded_contents(): void {
$this->assertSame(null, \logstore_standard\log\store::decode_other(null));
}
@ -404,7 +404,7 @@ class store_test extends \advanced_testcase {
* @param bool $jsonformat True to test with JSON format
* @dataProvider log_writing_provider
*/
public function test_backup_restore(bool $jsonformat) {
public function test_backup_restore(bool $jsonformat): void {
global $DB;
$this->resetAfterTest();
$this->preventResetByRollback();

View File

@ -24,7 +24,7 @@ namespace tool_log;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class manager_test extends \advanced_testcase {
public function test_get_log_manager() {
public function test_get_log_manager(): void {
global $CFG;
$this->resetAfterTest();

View File

@ -57,7 +57,7 @@ class provider_test extends provider_testcase {
$this->preventResetByRollback(); // Logging waits till the transaction gets committed.
}
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
$admin = \core_user::get_user(2);
$u1 = $this->getDataGenerator()->create_user();
$c1 = $this->getDataGenerator()->create_course();
@ -73,7 +73,7 @@ class provider_test extends provider_testcase {
$this->assertEquals($c1ctx->id, provider::get_contexts_for_userid($u1->id)->get_contextids()[0]);
}
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB;
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -107,7 +107,7 @@ class provider_test extends provider_testcase {
$this->assertEquals(1, $DB->count_records('logstore_standard_log', ['userid' => $u2->id]));
}
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB;
$u1 = $this->getDataGenerator()->create_user();
$u2 = $this->getDataGenerator()->create_user();
@ -141,7 +141,7 @@ class provider_test extends provider_testcase {
$this->assertEquals(0, $DB->count_records('logstore_standard_log', ['userid' => $u2->id]));
}
public function test_export_data_for_user() {
public function test_export_data_for_user(): void {
$admin = \core_user::get_user(2);
$u1 = $this->getDataGenerator()->create_user();
$c1 = $this->getDataGenerator()->create_course();

View File

@ -131,7 +131,7 @@ class externallib_test extends externallib_advanced_testcase {
accesslib_clear_all_caches_for_unit_testing();
}
public function test_search_users_by_capability() {
public function test_search_users_by_capability(): void {
global $CFG;
$this->resetAfterTest(true);
@ -214,7 +214,7 @@ class externallib_test extends externallib_advanced_testcase {
/**
* Ensures that overrides, as well as system permissions, are respected.
*/
public function test_search_users_by_capability_the_comeback() {
public function test_search_users_by_capability_the_comeback(): void {
$this->resetAfterTest();
$dg = $this->getDataGenerator();
@ -275,7 +275,7 @@ class externallib_test extends externallib_advanced_testcase {
$this->assertArrayHasKey($slave1->id, $result['users']);
}
public function test_search_users() {
public function test_search_users(): void {
global $CFG;
$this->resetAfterTest(true);
@ -398,7 +398,7 @@ class externallib_test extends externallib_advanced_testcase {
$this->assertEmpty($result['users'][0]['institution']);
}
public function test_data_for_user_competency_summary_in_plan() {
public function test_data_for_user_competency_summary_in_plan(): void {
global $CFG;
$this->setUser($this->creator);
@ -428,7 +428,7 @@ class externallib_test extends externallib_advanced_testcase {
$this->assertEquals('A', $summary->usercompetencysummary->evidence[1]->gradename);
}
public function test_data_for_user_competency_summary() {
public function test_data_for_user_competency_summary(): void {
$this->setUser($this->creator);
$dg = $this->getDataGenerator();
@ -446,7 +446,7 @@ class externallib_test extends externallib_advanced_testcase {
$this->assertEquals('A', $summary->evidence[1]->gradename);
}
public function test_data_for_course_competency_page() {
public function test_data_for_course_competency_page(): void {
$this->setAdminUser();
$dg = $this->getDataGenerator();

View File

@ -27,7 +27,7 @@ use core_competency\api;
*/
class import_test extends \advanced_testcase {
public function test_import_framework() {
public function test_import_framework(): void {
$this->resetAfterTest(true);
$this->setAdminUser();

View File

@ -166,7 +166,7 @@ class processor_test extends \advanced_testcase {
$this->cmcs = $cmcs;
}
public function test_simple_migration() {
public function test_simple_migration(): void {
$this->setAdminUser();
$mapper = new framework_mapper($this->f1->get('id'), $this->f2->get('id'));
@ -202,7 +202,7 @@ class processor_test extends \advanced_testcase {
$this->assertModuleCompetencyExists($this->cms[$this->c1->id]['F1'], $this->f1comps['X1']);
}
public function test_remove_when_missing() {
public function test_remove_when_missing(): void {
$this->setAdminUser();
$mapper = new framework_mapper($this->f1->get('id'), $this->f2->get('id'));
@ -228,7 +228,7 @@ class processor_test extends \advanced_testcase {
$this->assertModuleCompetencyNotExists($this->cms[$this->c1->id]['F1'], $this->f1comps['X1']);
}
public function test_allowed_courses() {
public function test_allowed_courses(): void {
$this->setAdminUser();
$mapper = new framework_mapper($this->f1->get('id'), $this->f2->get('id'));
@ -261,7 +261,7 @@ class processor_test extends \advanced_testcase {
$this->assertModuleCompetencyNotMigrated($this->cms[$this->c2->id]['F1'], $this->f1comps['A3'], $this->f2comps['A3']);
}
public function test_disallowed_courses() {
public function test_disallowed_courses(): void {
$this->setAdminUser();
$mapper = new framework_mapper($this->f1->get('id'), $this->f2->get('id'));
@ -294,7 +294,7 @@ class processor_test extends \advanced_testcase {
$this->assertModuleCompetencyNotMigrated($this->cms[$this->c2->id]['F1'], $this->f1comps['A3'], $this->f2comps['A3']);
}
public function test_course_start_date_from() {
public function test_course_start_date_from(): void {
$this->setAdminUser();
$mapper = new framework_mapper($this->f1->get('id'), $this->f2->get('id'));
@ -327,7 +327,7 @@ class processor_test extends \advanced_testcase {
$this->assertModuleCompetencyMigrated($this->cms[$this->c2->id]['F1'], $this->f1comps['A3'], $this->f2comps['A3']);
}
public function test_destination_competency_exists() {
public function test_destination_competency_exists(): void {
$this->setAdminUser();
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
@ -375,7 +375,7 @@ class processor_test extends \advanced_testcase {
$this->assertModuleCompetencyExists($this->cms[$this->c2->id]['F1'], $this->f1comps['A2']);
}
public function test_destination_competency_exists_remove_original() {
public function test_destination_competency_exists_remove_original(): void {
$this->setAdminUser();
$lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
@ -411,7 +411,7 @@ class processor_test extends \advanced_testcase {
$this->assertModuleCompetencyNotExists($this->cms[$this->c2->id]['F1'], $this->f1comps['A2']);
}
public function test_permission_exception() {
public function test_permission_exception(): void {
$this->preventResetByRollback(); // Test uses transactions, so we cannot use them for speedy reset.

View File

@ -43,7 +43,7 @@ class manager_test extends provider_testcase {
$CFG->messageinbound_domain = 'example.com';
}
public function test_tidy_old_verification_failures() {
public function test_tidy_old_verification_failures(): void {
global $DB;
$now = time();

View File

@ -57,7 +57,7 @@ class provider_test extends provider_testcase {
$CFG->messageinbound_domain = 'example.com';
}
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
$dg = $this->getDataGenerator();
$u1 = $dg->create_user();
$u2 = $dg->create_user();
@ -76,7 +76,7 @@ class provider_test extends provider_testcase {
/**
* Test for provider::test_get_users_in_context().
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
$component = 'tool_messageinbound';
$dg = $this->getDataGenerator();
$u1 = $dg->create_user();
@ -118,7 +118,7 @@ class provider_test extends provider_testcase {
$this->assertCount(0, $userids);
}
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB;
$dg = $this->getDataGenerator();
$u1 = $dg->create_user();
@ -161,7 +161,7 @@ class provider_test extends provider_testcase {
/**
* Test for provider::test_delete_data_for_users().
*/
public function test_delete_data_for_users() {
public function test_delete_data_for_users(): void {
global $DB;
$component = 'tool_messageinbound';
$dg = $this->getDataGenerator();
@ -210,7 +210,7 @@ class provider_test extends provider_testcase {
$this->assertTrue($DB->record_exists('messageinbound_messagelist', ['userid' => $u2->id]));
}
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB;
$dg = $this->getDataGenerator();
$u1 = $dg->create_user();
@ -243,7 +243,7 @@ class provider_test extends provider_testcase {
$this->assertTrue($DB->record_exists('messageinbound_messagelist', ['userid' => $u2->id]));
}
public function test_export_data_for_user() {
public function test_export_data_for_user(): void {
$dg = $this->getDataGenerator();
$u1 = $dg->create_user();
$u2 = $dg->create_user();

View File

@ -32,7 +32,7 @@ class factor_test extends \advanced_testcase {
* @covers ::get_summary_condition
* @covers ::get_cohorts
*/
public function test_get_summary_condition() {
public function test_get_summary_condition(): void {
$this->resetAfterTest();
set_config('enabled', 1, 'factor_cohort');

View File

@ -32,7 +32,7 @@ class factor_test extends \advanced_testcase {
* @covers ::check_verification_code
* @covers ::post_pass_state
*/
public function test_check_verification_code() {
public function test_check_verification_code(): void {
global $DB, $USER;
$this->resetAfterTest(true);

View File

@ -32,7 +32,7 @@ class factor_test extends \advanced_testcase {
* @covers ::get_affecting_factors
* @return void
*/
public function test_affecting_factors() {
public function test_affecting_factors(): void {
$this->resetAfterTest(true);
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);

View File

@ -32,7 +32,7 @@ class factor_test extends \advanced_testcase {
* @covers ::get_summary_condition
* @covers ::get_roles
*/
public function test_get_summary_condition() {
public function test_get_summary_condition(): void {
global $DB;
$this->resetAfterTest();

View File

@ -45,7 +45,7 @@ class factor_test extends \advanced_testcase {
* @covers ::calculate_expiry_time
* @return void
*/
public function test_calculate_expiry_time_in_general() {
public function test_calculate_expiry_time_in_general(): void {
$timestamp = 1642213800; // 1230 UTC.
set_config('expireovernight', 0, 'factor_token');
@ -91,7 +91,7 @@ class factor_test extends \advanced_testcase {
* @param int $timestamp
* @dataProvider timestamp_provider
*/
public function test_calculate_expiry_time_for_overnight_expiry_with_one_day_expiry($timestamp) {
public function test_calculate_expiry_time_for_overnight_expiry_with_one_day_expiry($timestamp): void {
// Setup configuration.
$method = new \ReflectionMethod($this->factor, 'calculate_expiry_time');
set_config('expireovernight', 1, 'factor_token');
@ -139,7 +139,7 @@ class factor_test extends \advanced_testcase {
* @param int $timestamp
* @dataProvider timestamp_provider
*/
public function test_calculate_expiry_time_for_overnight_expiry_with_two_day_expiry($timestamp) {
public function test_calculate_expiry_time_for_overnight_expiry_with_two_day_expiry($timestamp): void {
// Setup configuration.
$method = new \ReflectionMethod($this->factor, 'calculate_expiry_time');
set_config('expireovernight', 1, 'factor_token');
@ -189,7 +189,7 @@ class factor_test extends \advanced_testcase {
* @param int $timestamp
* @dataProvider timestamp_provider
*/
public function test_calculate_expiry_time_for_overnight_expiry_with_three_hour_expiry($timestamp) {
public function test_calculate_expiry_time_for_overnight_expiry_with_three_hour_expiry($timestamp): void {
// Setup configuration.
$method = new \ReflectionMethod($this->factor, 'calculate_expiry_time');
set_config('expireovernight', 1, 'factor_token');
@ -233,7 +233,7 @@ class factor_test extends \advanced_testcase {
* @param int $timestamp
* @dataProvider timestamp_provider
*/
public function test_calculate_expiry_time_for_overnight_expiry_with_an_hour_expiry($timestamp) {
public function test_calculate_expiry_time_for_overnight_expiry_with_an_hour_expiry($timestamp): void {
// Setup configuration.
$method = new \ReflectionMethod($this->factor, 'calculate_expiry_time');
set_config('expireovernight', 1, 'factor_token');

View File

@ -45,7 +45,7 @@ class factor_test extends \advanced_testcase {
/**
* Test code validation of the TOTP factor
*/
public function test_validate_code() {
public function test_validate_code(): void {
global $DB;
$this->resetAfterTest(true);
@ -123,7 +123,7 @@ class factor_test extends \advanced_testcase {
*
* @covers ::setup_user_factor
*/
public function test_wont_store_same_secret_twice() {
public function test_wont_store_same_secret_twice(): void {
global $DB;
$this->resetAfterTest(true);
$user = $this->getDataGenerator()->create_user();

View File

@ -38,7 +38,7 @@ class admin_setting_managemfa_test extends \advanced_testcase {
*
* @covers ::get_factor_combinations
*/
public function test_get_factor_combinations_default() {
public function test_get_factor_combinations_default(): void {
$namagemfa = new \tool_mfa\local\admin_setting_managemfa();
$factors = \tool_mfa\plugininfo\factor::get_enabled_factors();
$combinations = $namagemfa->get_factor_combinations($factors, 0, count($factors) - 1);
@ -141,7 +141,7 @@ class admin_setting_managemfa_test extends \advanced_testcase {
* @param array $factorset configured factors
* @param int $combinationscount expected count of available combinations
*/
public function test_get_factor_combinations_with_data_provider($factorset, $combinationscount) {
public function test_get_factor_combinations_with_data_provider($factorset, $combinationscount): void {
$this->resetAfterTest();
$enabledcount = 0;
@ -174,7 +174,7 @@ class admin_setting_managemfa_test extends \advanced_testcase {
*
* @covers ::get_factor_combinations
*/
public function test_factor_combination_checker() {
public function test_factor_combination_checker(): void {
$this->resetAfterTest();
$managemfa = new \tool_mfa\local\admin_setting_managemfa();
$user = $this->getDataGenerator()->create_user();

Some files were not shown because too many files have changed in this diff Show More