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
+17 -17
View File
@@ -61,7 +61,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to none, logging should not start.
*/
public function test_logmode_none() {
public function test_logmode_none(): void {
global $CFG;
$this->resetAfterTest();
@@ -79,7 +79,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to all that log capture is started.
*/
public function test_start_logmode_all() {
public function test_start_logmode_all(): void {
global $CFG;
$this->resetAfterTest();
@@ -100,7 +100,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to fail that log capture is started.
*/
public function test_start_logmode_fail() {
public function test_start_logmode_fail(): void {
global $CFG;
$this->resetAfterTest();
@@ -121,7 +121,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to fail, passing adhoc tests should not be logged.
*/
public function test_logmode_fail_with_passing_adhoc_task() {
public function test_logmode_fail_with_passing_adhoc_task(): void {
global $CFG;
$this->resetAfterTest();
@@ -142,7 +142,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to fail, passing scheduled tests should not be logged.
*/
public function test_logmode_fail_with_passing_scheduled_task() {
public function test_logmode_fail_with_passing_scheduled_task(): void {
global $CFG;
$this->resetAfterTest();
@@ -163,7 +163,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to fail, failing adhoc tests should be logged.
*/
public function test_logmode_fail_with_failing_adhoc_task() {
public function test_logmode_fail_with_failing_adhoc_task(): void {
global $CFG;
$this->resetAfterTest();
@@ -188,7 +188,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to fail, failing scheduled tests should be logged.
*/
public function test_logmode_fail_with_failing_scheduled_task() {
public function test_logmode_fail_with_failing_scheduled_task(): void {
global $CFG;
$this->resetAfterTest();
@@ -213,7 +213,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to fail, failing adhoc tests should be logged.
*/
public function test_logmode_any_with_failing_adhoc_task() {
public function test_logmode_any_with_failing_adhoc_task(): void {
global $CFG;
$this->resetAfterTest();
@@ -238,7 +238,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to fail, failing scheduled tests should be logged.
*/
public function test_logmode_any_with_failing_scheduled_task() {
public function test_logmode_any_with_failing_scheduled_task(): void {
global $CFG;
$this->resetAfterTest();
@@ -263,7 +263,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to fail, passing adhoc tests should be logged.
*/
public function test_logmode_any_with_passing_adhoc_task() {
public function test_logmode_any_with_passing_adhoc_task(): void {
global $CFG;
$this->resetAfterTest();
@@ -287,7 +287,7 @@ class logging_test extends \advanced_testcase {
/**
* When the logmode is set to fail, passing scheduled tests should be logged.
*/
public function test_logmode_any_with_passing_scheduled_task() {
public function test_logmode_any_with_passing_scheduled_task(): void {
global $CFG;
$this->resetAfterTest();
@@ -311,7 +311,7 @@ class logging_test extends \advanced_testcase {
/**
* Ensure that start_logging cannot be called in a nested fashion.
*/
public function test_prevent_nested_logging() {
public function test_prevent_nested_logging(): void {
$this->resetAfterTest();
$task = $this->get_test_adhoc_task();
@@ -324,7 +324,7 @@ class logging_test extends \advanced_testcase {
/**
* Ensure that logging can be called after a previous log has finished.
*/
public function test_repeated_usages() {
public function test_repeated_usages(): void {
$this->resetAfterTest();
$logger = $this->get_mocked_logger();
@@ -346,7 +346,7 @@ class logging_test extends \advanced_testcase {
/**
* Enusre that when finalise_log is called when logging is not active, nothing happens.
*/
public function test_finalise_log_no_logging() {
public function test_finalise_log_no_logging(): void {
$initialbufferstate = ob_get_status();
logmanager::finalise_log();
@@ -358,7 +358,7 @@ class logging_test extends \advanced_testcase {
/**
* When log capture is enabled, calls to the flush function should cause log output to be both returned and captured.
*/
public function test_flush_on_own_buffer() {
public function test_flush_on_own_buffer(): void {
$this->resetAfterTest();
$logger = $this->get_mocked_logger();
@@ -383,7 +383,7 @@ class logging_test extends \advanced_testcase {
/**
* When log capture is enabled, calls to the flush function should not affect any subsequent ob_start.
*/
public function test_flush_does_not_flush_inner_buffers() {
public function test_flush_does_not_flush_inner_buffers(): void {
$this->resetAfterTest();
$logger = $this->get_mocked_logger();
@@ -411,7 +411,7 @@ class logging_test extends \advanced_testcase {
/**
* When log capture is enabled, calls to the flush function should not affect any subsequent ob_start.
*/
public function test_inner_flushed_buffers_are_logged() {
public function test_inner_flushed_buffers_are_logged(): void {
$this->resetAfterTest();
$logger = $this->get_mocked_logger();