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
+3 -3
View File
@@ -36,7 +36,7 @@ class xmlize_test extends \basic_testcase {
* The test expected file was generated using the original xmlize
* implentation found at https://github.com/rmccue/XMLize/blob/master/xmlize-php5.inc.
*/
public function test_xmlimport_of_proper_file() {
public function test_xmlimport_of_proper_file(): void {
$xml = file_get_contents(__DIR__ . '/sample_questions.xml');
$serialised = file_get_contents(__DIR__ . '/sample_questions.ser');
$this->assertEquals(unserialize($serialised), xmlize($xml));
@@ -45,7 +45,7 @@ class xmlize_test extends \basic_testcase {
/**
* Test an XML import using invalid XML.
*/
public function test_xmlimport_of_wrong_file() {
public function test_xmlimport_of_wrong_file(): void {
$xml = file_get_contents(__DIR__ . '/sample_questions_wrong.xml');
$this->expectException('xml_format_exception');
$this->expectExceptionMessage('Error parsing XML: Mismatched tag at line 18, char 23');
@@ -55,7 +55,7 @@ class xmlize_test extends \basic_testcase {
/**
* Test an XML import using legacy question data with old image tag.
*/
public function test_xmlimport_of_sample_question_with_old_image_tag() {
public function test_xmlimport_of_sample_question_with_old_image_tag(): void {
$xml = file_get_contents(__DIR__ . '/sample_questions_with_old_image_tag.xml');
$serialised = file_get_contents(__DIR__ . '/sample_questions_with_old_image_tag.ser');