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:
@@ -44,7 +44,7 @@ class basenestedelement_test extends \basic_testcase {
|
||||
/**
|
||||
* Correct creation tests (attributes and final elements)
|
||||
*/
|
||||
public function test_creation() {
|
||||
public function test_creation(): void {
|
||||
// Create instance with name, attributes and values and check all them
|
||||
$instance = new mock_base_nested_element('NAME', array('ATTR1', 'ATTR2'), array('VAL1', 'VAL2', 'VAL3'));
|
||||
$this->assertInstanceOf('base_nested_element', $instance);
|
||||
@@ -182,7 +182,7 @@ class basenestedelement_test extends \basic_testcase {
|
||||
/**
|
||||
* Incorrect creation tests (attributes and final elements)
|
||||
*/
|
||||
function test_wrong_creation() {
|
||||
function test_wrong_creation(): void {
|
||||
|
||||
// Create instance with invalid name
|
||||
try {
|
||||
@@ -251,7 +251,7 @@ class basenestedelement_test extends \basic_testcase {
|
||||
/**
|
||||
* Correct tree tests (children stuff)
|
||||
*/
|
||||
function test_tree() {
|
||||
function test_tree(): void {
|
||||
|
||||
// Create parent and child instances, tree-ing them
|
||||
$parent = new mock_base_nested_element('PARENT');
|
||||
@@ -305,7 +305,7 @@ class basenestedelement_test extends \basic_testcase {
|
||||
/**
|
||||
* Incorrect tree tests (children stuff)
|
||||
*/
|
||||
function test_wrong_tree() {
|
||||
function test_wrong_tree(): void {
|
||||
|
||||
// Add null object child
|
||||
$parent = new mock_base_nested_element('PARENT');
|
||||
|
||||
Reference in New Issue
Block a user