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:
@@ -39,7 +39,7 @@ class manager_test extends \advanced_testcase {
|
||||
* @covers ::create_from_coursemodule
|
||||
* @covers ::create_from_data_record
|
||||
*/
|
||||
public function test_create() {
|
||||
public function test_create(): void {
|
||||
|
||||
$this->resetAfterTest();
|
||||
$this->setAdminUser();
|
||||
@@ -87,7 +87,7 @@ class manager_test extends \advanced_testcase {
|
||||
* Test set_module_viewed
|
||||
* @covers ::set_module_viewed
|
||||
*/
|
||||
public function test_set_module_viewed() {
|
||||
public function test_set_module_viewed(): void {
|
||||
global $CFG;
|
||||
|
||||
$CFG->enablecompletion = 1;
|
||||
@@ -133,7 +133,7 @@ class manager_test extends \advanced_testcase {
|
||||
* Test set_template_viewed
|
||||
* @covers ::set_template_viewed
|
||||
*/
|
||||
public function test_set_template_viewed() {
|
||||
public function test_set_template_viewed(): void {
|
||||
$this->resetAfterTest();
|
||||
$this->setAdminUser();
|
||||
|
||||
@@ -169,7 +169,7 @@ class manager_test extends \advanced_testcase {
|
||||
*
|
||||
* @covers ::has_records
|
||||
*/
|
||||
public function test_has_records() {
|
||||
public function test_has_records(): void {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest();
|
||||
@@ -196,7 +196,7 @@ class manager_test extends \advanced_testcase {
|
||||
*
|
||||
* @covers ::has_fields
|
||||
*/
|
||||
public function test_has_fields() {
|
||||
public function test_has_fields(): void {
|
||||
$this->resetAfterTest();
|
||||
|
||||
$course = $this->getDataGenerator()->create_course();
|
||||
@@ -439,7 +439,7 @@ class manager_test extends \advanced_testcase {
|
||||
* @param bool $plugin if the preset is a plugin or not
|
||||
* @param bool $expected the expected result
|
||||
*/
|
||||
public function test_can_view_preset(string $rolename, bool $ownpreset, ?bool $useridparam, bool $plugin, bool $expected) {
|
||||
public function test_can_view_preset(string $rolename, bool $ownpreset, ?bool $useridparam, bool $plugin, bool $expected): void {
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
@@ -578,7 +578,7 @@ class manager_test extends \advanced_testcase {
|
||||
*
|
||||
* @covers ::can_export_entries
|
||||
*/
|
||||
public function test_can_export_entries() {
|
||||
public function test_can_export_entries(): void {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest();
|
||||
@@ -643,7 +643,7 @@ class manager_test extends \advanced_testcase {
|
||||
*
|
||||
* @covers ::reset_all_templates
|
||||
*/
|
||||
public function test_reset_all_templates() {
|
||||
public function test_reset_all_templates(): void {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest();
|
||||
@@ -689,7 +689,7 @@ class manager_test extends \advanced_testcase {
|
||||
* @param string $templatetoreset the template to reset
|
||||
* @param string[] $expected the expected templates to be reset
|
||||
*/
|
||||
public function test_reset_template(string $templatetoreset, array $expected) {
|
||||
public function test_reset_template(string $templatetoreset, array $expected): void {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
Reference in New Issue
Block a user