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:
@@ -78,7 +78,7 @@ class custom_completion_test extends advanced_testcase {
|
||||
* @param int|null $status Expected status.
|
||||
* @param string|null $exception Expected exception.
|
||||
*/
|
||||
public function test_get_state(string $rule, int $available, int $entries, ?int $status, ?string $exception) {
|
||||
public function test_get_state(string $rule, int $available, int $entries, ?int $status, ?string $exception): void {
|
||||
global $DB;
|
||||
|
||||
if (!is_null($exception)) {
|
||||
@@ -119,7 +119,7 @@ class custom_completion_test extends advanced_testcase {
|
||||
/**
|
||||
* Test for get_defined_custom_rules().
|
||||
*/
|
||||
public function test_get_defined_custom_rules() {
|
||||
public function test_get_defined_custom_rules(): void {
|
||||
$rules = custom_completion::get_defined_custom_rules();
|
||||
$this->assertCount(1, $rules);
|
||||
$this->assertEquals('completionentries', reset($rules));
|
||||
@@ -128,7 +128,7 @@ class custom_completion_test extends advanced_testcase {
|
||||
/**
|
||||
* Test for get_defined_custom_rule_descriptions().
|
||||
*/
|
||||
public function test_get_custom_rule_descriptions() {
|
||||
public function test_get_custom_rule_descriptions(): void {
|
||||
// Get defined custom rules.
|
||||
$rules = custom_completion::get_defined_custom_rules();
|
||||
// Build a mock cm_info instance.
|
||||
@@ -153,7 +153,7 @@ class custom_completion_test extends advanced_testcase {
|
||||
/**
|
||||
* Test for is_defined().
|
||||
*/
|
||||
public function test_is_defined() {
|
||||
public function test_is_defined(): void {
|
||||
// Build a mock cm_info instance.
|
||||
$mockcminfo = $this->getMockBuilder(cm_info::class)
|
||||
->disableOriginalConstructor()
|
||||
@@ -191,7 +191,7 @@ class custom_completion_test extends advanced_testcase {
|
||||
* @param int $status
|
||||
* @param array $expected
|
||||
*/
|
||||
public function test_get_available_custom_rules(int $status, array $expected) {
|
||||
public function test_get_available_custom_rules(int $status, array $expected): void {
|
||||
$customdataval = [
|
||||
'customcompletionrules' => [
|
||||
'completionentries' => $status
|
||||
|
||||
Reference in New Issue
Block a user