From cd11b9533f0a3ff0b016dbe05e2cd0e15b9ad6b5 Mon Sep 17 00:00:00 2001 From: Philipp Imhof <52650214+PhilippImhof@users.noreply.github.com> Date: Fri, 6 Jun 2025 15:20:04 +0200 Subject: [PATCH] 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. --- mod/quiz/tests/backup/repeated_restore_test.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/quiz/tests/backup/repeated_restore_test.php b/mod/quiz/tests/backup/repeated_restore_test.php index af0c2635fb0..a8df18a7f5d 100644 --- a/mod/quiz/tests/backup/repeated_restore_test.php +++ b/mod/quiz/tests/backup/repeated_restore_test.php @@ -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);