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 11:55:07 +02:00
parent d3ae1391ab
commit 01148a0816
1360 changed files with 9928 additions and 9928 deletions
@@ -40,7 +40,7 @@ class skip_future_documents_iterator_test extends \basic_testcase {
/**
* Test normal case with all documents in the past.
*/
public function test_iterator_all_in_past() {
public function test_iterator_all_in_past(): void {
$past = strtotime('2017-11-01');
$documents = [
self::make_doc($past, 1),
@@ -55,7 +55,7 @@ class skip_future_documents_iterator_test extends \basic_testcase {
* Confirm that the iterator does not call its parent iterator current() function too many
* times.
*/
public function test_iterator_performance() {
public function test_iterator_performance(): void {
$counter = new test_counting_iterator();
$iterator = new skip_future_documents_iterator($counter);
$items = 0;
@@ -70,14 +70,14 @@ class skip_future_documents_iterator_test extends \basic_testcase {
/**
* Test with no documents at all.
*/
public function test_iterator_empty() {
public function test_iterator_empty(): void {
$this->assertEquals('', self::do_iterator([]));
}
/**
* Test if some documents are in the future.
*/
public function test_iterator_some_in_future() {
public function test_iterator_some_in_future(): void {
$past = strtotime('2017-11-01');
$future = time() + 1000;
$documents = [
@@ -92,7 +92,7 @@ class skip_future_documents_iterator_test extends \basic_testcase {
/**
* Test if all documents are in the future.
*/
public function test_iterator_all_in_future() {
public function test_iterator_all_in_future(): void {
$future = time() + 1000;
$documents = [
self::make_doc($future, 1),
@@ -105,7 +105,7 @@ class skip_future_documents_iterator_test extends \basic_testcase {
/**
* Test when some documents return error.
*/
public function test_iterator_some_false() {
public function test_iterator_some_false(): void {
$past = strtotime('2017-11-01');
$documents = [
self::make_doc($past, 1),
@@ -119,7 +119,7 @@ class skip_future_documents_iterator_test extends \basic_testcase {
/**
* Test when all documents return error.
*/
public function test_iterator_all_false() {
public function test_iterator_all_false(): void {
$documents = [
false,
false,
@@ -132,7 +132,7 @@ class skip_future_documents_iterator_test extends \basic_testcase {
/**
* Test iterator with all cases.
*/
public function test_iterator_past_false_and_future() {
public function test_iterator_past_false_and_future(): void {
$past = strtotime('2017-11-01');
$future = time() + 1000;
$documents = [