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
+8 -8
View File
@@ -31,7 +31,7 @@ require_once(__DIR__.'/fixtures/testable_update_code_manager.php');
*/
class update_code_manager_test extends \advanced_testcase {
public function test_get_remote_plugin_zip() {
public function test_get_remote_plugin_zip(): void {
$codeman = new \core\update\testable_code_manager();
$this->assertFalse($codeman->get_remote_plugin_zip('ftp://not.support.ed/', 'doesnotmatter'));
@@ -49,7 +49,7 @@ class update_code_manager_test extends \advanced_testcase {
$this->assertEquals(3, $codeman->downloadscounter);
}
public function test_get_remote_plugin_zip_corrupted_cache() {
public function test_get_remote_plugin_zip_corrupted_cache(): void {
$temproot = make_request_directory();
$codeman = new \core\update\testable_code_manager(null, $temproot);
@@ -64,7 +64,7 @@ class update_code_manager_test extends \advanced_testcase {
$this->assertEquals(file_get_contents($returned), 'http://valid/');
}
public function test_unzip_plugin_file() {
public function test_unzip_plugin_file(): void {
$codeman = new \core\update\testable_code_manager();
$zipfilepath = __DIR__.'/fixtures/update_validator/zips/invalidroot.zip';
$targetdir = make_request_directory();
@@ -106,7 +106,7 @@ class update_code_manager_test extends \advanced_testcase {
$files = $codeman->unzip_plugin_file($zipfilepath, $targetdir, 'bar');
}
public function test_unzip_plugin_file_multidir() {
public function test_unzip_plugin_file_multidir(): void {
$codeman = new \core\update\testable_code_manager();
$zipfilepath = __DIR__.'/fixtures/update_validator/zips/multidir.zip';
$targetdir = make_request_directory();
@@ -115,7 +115,7 @@ class update_code_manager_test extends \advanced_testcase {
$files = $codeman->unzip_plugin_file($zipfilepath, $targetdir, 'foo');
}
public function test_get_plugin_zip_root_dir() {
public function test_get_plugin_zip_root_dir(): void {
$codeman = new \core\update\testable_code_manager();
$zipfilepath = __DIR__.'/fixtures/update_validator/zips/invalidroot.zip';
@@ -128,7 +128,7 @@ class update_code_manager_test extends \advanced_testcase {
$this->assertSame(false, $codeman->get_plugin_zip_root_dir($zipfilepath));
}
public function test_list_plugin_folder_files() {
public function test_list_plugin_folder_files(): void {
$fixtures = __DIR__.'/fixtures/update_validator/plugindir';
$codeman = new \core\update\testable_code_manager();
$files = $codeman->list_plugin_folder_files($fixtures.'/foobar');
@@ -139,7 +139,7 @@ class update_code_manager_test extends \advanced_testcase {
$this->assertEquals($files['foobar/lang/en/local_foobar.php'], $fixtures.'/foobar/lang/en/local_foobar.php');
}
public function test_zip_plugin_folder() {
public function test_zip_plugin_folder(): void {
$fixtures = __DIR__.'/fixtures/update_validator/plugindir';
$storage = make_request_directory();
$codeman = new \core\update\testable_code_manager();
@@ -158,7 +158,7 @@ class update_code_manager_test extends \advanced_testcase {
}
}
public function test_archiving_plugin_version() {
public function test_archiving_plugin_version(): void {
$fixtures = __DIR__.'/fixtures/update_validator/plugindir';
$codeman = new \core\update\testable_code_manager();