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:
@@ -32,7 +32,7 @@ class ip_utils_test extends \basic_testcase {
|
||||
* @param bool $expected the expected result.
|
||||
* @dataProvider domain_name_data_provider
|
||||
*/
|
||||
public function test_is_domain_name($domainname, $expected) {
|
||||
public function test_is_domain_name($domainname, $expected): void {
|
||||
$this->assertEquals($expected, \core\ip_utils::is_domain_name($domainname));
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class ip_utils_test extends \basic_testcase {
|
||||
* @param bool $expected the expected result.
|
||||
* @dataProvider domain_matching_patterns_data_provider
|
||||
*/
|
||||
public function test_is_domain_matching_pattern($str, $expected) {
|
||||
public function test_is_domain_matching_pattern($str, $expected): void {
|
||||
$this->assertEquals($expected, \core\ip_utils::is_domain_matching_pattern($str));
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ class ip_utils_test extends \basic_testcase {
|
||||
* @param bool $expected the expected result.
|
||||
* @dataProvider ip_address_data_provider
|
||||
*/
|
||||
public function test_is_ip_address($address, $expected) {
|
||||
public function test_is_ip_address($address, $expected): void {
|
||||
$this->assertEquals($expected, \core\ip_utils::is_ip_address($address));
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ class ip_utils_test extends \basic_testcase {
|
||||
* @param bool $expected the expected result.
|
||||
* @dataProvider ipv4_address_data_provider
|
||||
*/
|
||||
public function test_is_ipv4_address($address, $expected) {
|
||||
public function test_is_ipv4_address($address, $expected): void {
|
||||
$this->assertEquals($expected, \core\ip_utils::is_ipv4_address($address));
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ class ip_utils_test extends \basic_testcase {
|
||||
* @param bool $expected the expected result.
|
||||
* @dataProvider ipv4_range_data_provider
|
||||
*/
|
||||
public function test_is_ipv4_range($addressrange, $expected) {
|
||||
public function test_is_ipv4_range($addressrange, $expected): void {
|
||||
$this->assertEquals($expected, \core\ip_utils::is_ipv4_range($addressrange));
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ class ip_utils_test extends \basic_testcase {
|
||||
* @param bool $expected the expected result.
|
||||
* @dataProvider ipv6_address_data_provider
|
||||
*/
|
||||
public function test_is_ipv6_address($address, $expected) {
|
||||
public function test_is_ipv6_address($address, $expected): void {
|
||||
$this->assertEquals($expected, \core\ip_utils::is_ipv6_address($address));
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ class ip_utils_test extends \basic_testcase {
|
||||
* @param bool $expected the expected result.
|
||||
* @dataProvider ipv6_range_data_provider
|
||||
*/
|
||||
public function test_is_ipv6_range($addressrange, $expected) {
|
||||
public function test_is_ipv6_range($addressrange, $expected): void {
|
||||
$this->assertEquals($expected, \core\ip_utils::is_ipv6_range($addressrange));
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ class ip_utils_test extends \basic_testcase {
|
||||
* @param string $domain domain address
|
||||
* @dataProvider data_domain_addresses
|
||||
*/
|
||||
public function test_check_domain_against_allowed_domains($expected, $domain) {
|
||||
public function test_check_domain_against_allowed_domains($expected, $domain): void {
|
||||
$alloweddomains = ['example.com',
|
||||
'*.moodle.com',
|
||||
'*.per.this.penny-arcade.com',
|
||||
@@ -396,7 +396,7 @@ class ip_utils_test extends \basic_testcase {
|
||||
* @param string $delim delimiter of list
|
||||
* @dataProvider data_is_ip_in_subnet_list
|
||||
*/
|
||||
public function test_is_ip_in_subnet_list($expected, $ip, $list, $delim) {
|
||||
public function test_is_ip_in_subnet_list($expected, $ip, $list, $delim): void {
|
||||
$this->assertEquals($expected, \core\ip_utils::is_ip_in_subnet_list($ip, $list, $delim));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user