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
+6 -6
View File
@@ -86,7 +86,7 @@ class course_image_cache_test extends \advanced_testcase {
/**
* Test exception if try to get an image for non existing course.
*/
public function test_getting_data_if_course_is_not_exist() {
public function test_getting_data_if_course_is_not_exist(): void {
$this->expectException('dml_missing_record_exception');
$this->expectExceptionMessageMatches("/Can't find data record in database table course./");
$this->assertFalse(\cache::make('core', 'course_image')->get(999));
@@ -95,7 +95,7 @@ class course_image_cache_test extends \advanced_testcase {
/**
* Test get_image_url_from_overview_files when no summary files in the course.
*/
public function test_get_image_url_from_overview_files_return_null_if_no_summary_files_in_the_course() {
public function test_get_image_url_from_overview_files_return_null_if_no_summary_files_in_the_course(): void {
$method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
$cache = course_image::get_instance_for_cache(new cache_definition());
@@ -107,7 +107,7 @@ class course_image_cache_test extends \advanced_testcase {
/**
* Test get_image_url_from_overview_files when no summary images in the course.
*/
public function test_get_image_url_from_overview_files_returns_null_if_no_summary_images_in_the_course() {
public function test_get_image_url_from_overview_files_returns_null_if_no_summary_images_in_the_course(): void {
$method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
$cache = course_image::get_instance_for_cache(new cache_definition());
@@ -120,7 +120,7 @@ class course_image_cache_test extends \advanced_testcase {
/**
* Test get_image_url_from_overview_files when no summary images in the course.
*/
public function test_get_image_url_from_overview_files_returns_url_if_there_is_a_summary_image() {
public function test_get_image_url_from_overview_files_returns_url_if_there_is_a_summary_image(): void {
$method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
$cache = course_image::get_instance_for_cache(new cache_definition());
@@ -134,7 +134,7 @@ class course_image_cache_test extends \advanced_testcase {
/**
* Test get_image_url_from_overview_files when several summary images in the course.
*/
public function test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_images() {
public function test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_images(): void {
$method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
$cache = course_image::get_instance_for_cache(new cache_definition());
@@ -152,7 +152,7 @@ class course_image_cache_test extends \advanced_testcase {
/**
* Test get_image_url_from_overview_files when several summary files in the course.
*/
public function test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_files() {
public function test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_files(): void {
$method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
$cache = course_image::get_instance_for_cache(new cache_definition());