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:
@@ -42,35 +42,35 @@ require_once(__DIR__ . '/../behaviour.php');
|
||||
*/
|
||||
class missingbehaviour_test extends \advanced_testcase {
|
||||
|
||||
public function test_missing_cannot_start() {
|
||||
public function test_missing_cannot_start(): void {
|
||||
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
||||
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
||||
$this->expectException(\moodle_exception::class);
|
||||
$behaviour->init_first_step(new question_attempt_step(array()), 1);
|
||||
}
|
||||
|
||||
public function test_missing_cannot_process() {
|
||||
public function test_missing_cannot_process(): void {
|
||||
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
||||
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
||||
$this->expectException(\moodle_exception::class);
|
||||
$behaviour->process_action(new question_attempt_pending_step(array()));
|
||||
}
|
||||
|
||||
public function test_missing_cannot_get_min_fraction() {
|
||||
public function test_missing_cannot_get_min_fraction(): void {
|
||||
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
||||
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
||||
$this->expectException(\moodle_exception::class);
|
||||
$behaviour->get_min_fraction();
|
||||
}
|
||||
|
||||
public function test_missing_cannot_get_max_fraction() {
|
||||
public function test_missing_cannot_get_max_fraction(): void {
|
||||
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
||||
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
||||
$this->expectException(\moodle_exception::class);
|
||||
$behaviour->get_max_fraction();
|
||||
}
|
||||
|
||||
public function test_render_missing() {
|
||||
public function test_render_missing(): void {
|
||||
$records = new question_test_recordset(array(
|
||||
array('questionattemptid', 'contextid', 'questionusageid', 'slot',
|
||||
'behaviour', 'questionid', 'variant', 'maxmark', 'minfraction', 'maxfraction', 'flagged',
|
||||
|
||||
Reference in New Issue
Block a user