MDL-85350 questions: skip restore test for certain 3rd party plugins

The test_restore_course_with_same_stamp_questions() test assumes
that all question types using answers will also use the table
"question_answers" to store said answers. However, some 3rd party
qtypes might use custom tables and for those, the test would fail.
This commit is contained in:
Philipp Imhof
2025-06-06 15:22:19 +02:00
parent 812ef23c00
commit cd11b9533f
@@ -543,6 +543,11 @@ final class repeated_restore_test extends advanced_testcase {
"Cannot test edited answers for qtype_{$qtype} as it does not use answers.",
);
}
if ($DB->count_records('question_answers') === 0) {
$this->markTestSkipped(
"Cannot test edited answers for qtype_{$qtype} as it does not use the question_answers table.",
);
}
foreach ($question2data->options->answers as $answer) {
$answer->answer = 'New answer ' . $answer->id;
$DB->update_record('question_answers', $answer);