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

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

All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
This commit is contained in:
Eloy Lafuente (stronk7)
2024-06-11 12:18:04 +02:00
parent db07c09afc
commit 1093256560
1360 changed files with 9928 additions and 9928 deletions
+13 -13
View File
@@ -276,7 +276,7 @@ class statslib_test extends \advanced_testcase {
/**
* Test progress output when debug is on.
*/
public function test_statslib_progress_debug() {
public function test_statslib_progress_debug(): void {
set_debugging(DEBUG_ALL);
$this->expectOutputString('1:0 ');
stats_progress('init');
@@ -287,7 +287,7 @@ class statslib_test extends \advanced_testcase {
/**
* Test progress output when debug is off.
*/
public function test_statslib_progress_no_debug() {
public function test_statslib_progress_no_debug(): void {
set_debugging(DEBUG_NONE);
$this->expectOutputString('.');
stats_progress('init');
@@ -298,7 +298,7 @@ class statslib_test extends \advanced_testcase {
/**
* Test the function that gets the start date from the config.
*/
public function test_statslib_get_start_from() {
public function test_statslib_get_start_from(): void {
global $CFG, $DB;
$dataset = $this->load_xml_data_file(__DIR__."/fixtures/statslib-test01.xml");
@@ -387,7 +387,7 @@ class statslib_test extends \advanced_testcase {
* NOTE: I don't think this is the way this function should work.
* This test documents the current functionality.
*/
public function test_statslib_get_base_daily() {
public function test_statslib_get_base_daily(): void {
global $CFG;
for ($x = 0; $x < 13; $x += 1) {
@@ -405,7 +405,7 @@ class statslib_test extends \advanced_testcase {
/**
* Test the function that gets the start of the next day.
*/
public function test_statslib_get_next_day_start() {
public function test_statslib_get_next_day_start(): void {
$this->setTimezone(0);
$this->assertEquals(1272758400, stats_get_next_day_start(1272686410));
@@ -435,7 +435,7 @@ class statslib_test extends \advanced_testcase {
* @param string $timestart Date and time for which the first day of the week will be obtained
* @param string $expected Expected date of the first day of the week
*/
public function test_statslib_get_base_weekly($startwday, $timezone, $timestart, $expected) {
public function test_statslib_get_base_weekly($startwday, $timezone, $timestart, $expected): void {
$this->setTimezone($timezone);
$time = strtotime($timestart);
$expected = strtotime($expected);
@@ -453,7 +453,7 @@ class statslib_test extends \advanced_testcase {
* Note: The function results depend on installed modules. The hard coded lists are the
* defaults for a new Moodle 2.3 install.
*/
public function test_statslib_get_action_names() {
public function test_statslib_get_action_names(): void {
$basepostactions = array (
0 => 'add',
1 => 'delete',
@@ -536,7 +536,7 @@ class statslib_test extends \advanced_testcase {
/**
* Test the temporary table creation and deletion.
*/
public function test_statslib_temp_table_create_and_drop() {
public function test_statslib_temp_table_create_and_drop(): void {
global $DB;
foreach ($this->tables as $table) {
@@ -561,7 +561,7 @@ class statslib_test extends \advanced_testcase {
*
* @depends test_statslib_temp_table_create_and_drop
*/
public function test_statslib_temp_table_fill() {
public function test_statslib_temp_table_fill(): void {
global $CFG, $DB, $USER;
$dataset = $this->load_xml_data_file(__DIR__."/fixtures/statslib-test09.xml");
@@ -663,7 +663,7 @@ class statslib_test extends \advanced_testcase {
*
* @depends test_statslib_temp_table_create_and_drop
*/
public function test_statslib_temp_table_setup() {
public function test_statslib_temp_table_setup(): void {
global $DB;
$DB->delete_records('log');
@@ -681,7 +681,7 @@ class statslib_test extends \advanced_testcase {
*
* @depends test_statslib_temp_table_create_and_drop
*/
public function test_statslib_temp_table_clean() {
public function test_statslib_temp_table_clean(): void {
global $DB;
$rows = array(
@@ -721,7 +721,7 @@ class statslib_test extends \advanced_testcase {
* @depends test_statslib_temp_table_fill
* @dataProvider daily_log_provider
*/
public function test_statslib_cron_daily($xmlfile) {
public function test_statslib_cron_daily($xmlfile): void {
global $CFG, $DB;
$dataset = $this->load_xml_data_file(__DIR__."/fixtures/{$xmlfile}");
@@ -743,7 +743,7 @@ class statslib_test extends \advanced_testcase {
* @depends test_statslib_get_base_daily
* @depends test_statslib_get_next_day_start
*/
public function test_statslib_cron_daily_no_default_profile_id() {
public function test_statslib_cron_daily_no_default_profile_id(): void {
global $CFG, $DB;
$CFG->defaultfrontpageroleid = 0;