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:
+6
-6
@@ -170,7 +170,7 @@ class post_statement_test extends externallib_advanced_testcase {
|
||||
* @param string $component component name
|
||||
* @param array $expected expected results
|
||||
*/
|
||||
public function test_component_names(string $component, array $expected) {
|
||||
public function test_component_names(string $component, array $expected): void {
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
@@ -209,7 +209,7 @@ class post_statement_test extends externallib_advanced_testcase {
|
||||
* @dataProvider invalid_json_provider
|
||||
* @param string $json json string to send
|
||||
*/
|
||||
public function test_invalid_json(string $json) {
|
||||
public function test_invalid_json(string $json): void {
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
@@ -272,7 +272,7 @@ class post_statement_test extends externallib_advanced_testcase {
|
||||
* @param bool $validverb if the verb used is valid
|
||||
* @param array $expected expected results
|
||||
*/
|
||||
public function test_statements_agent(bool $multiple, bool $validactor, bool $validverb, array $expected) {
|
||||
public function test_statements_agent(bool $multiple, bool $validactor, bool $validverb, array $expected): void {
|
||||
global $USER;
|
||||
|
||||
$this->resetAfterTest();
|
||||
@@ -325,7 +325,7 @@ class post_statement_test extends externallib_advanced_testcase {
|
||||
* @param bool $validverb if the verb used is valid
|
||||
* @param array $expected expected results
|
||||
*/
|
||||
public function test_statements_group(bool $multiple, bool $validactor, bool $validverb, array $expected) {
|
||||
public function test_statements_group(bool $multiple, bool $validactor, bool $validverb, array $expected): void {
|
||||
global $USER, $CFG;
|
||||
|
||||
$this->resetAfterTest();
|
||||
@@ -418,7 +418,7 @@ class post_statement_test extends externallib_advanced_testcase {
|
||||
* @param bool $usegroup2 if the 2nd statement must be groupal
|
||||
* @param array $expected expected results
|
||||
*/
|
||||
public function test_group_disabled(bool $usegroup1, bool $usegroup2, array $expected) {
|
||||
public function test_group_disabled(bool $usegroup1, bool $usegroup2, array $expected): void {
|
||||
global $USER;
|
||||
|
||||
$this->resetAfterTest();
|
||||
@@ -473,7 +473,7 @@ class post_statement_test extends externallib_advanced_testcase {
|
||||
* If all statements from a batch are rejectes by the plugin the full
|
||||
* batch is considered rejected and an exception is returned.
|
||||
*/
|
||||
public function test_full_batch_rejected() {
|
||||
public function test_full_batch_rejected(): void {
|
||||
$this->resetAfterTest();
|
||||
|
||||
$this->setAdminUser();
|
||||
|
||||
Reference in New Issue
Block a user