From 8520187d0ed7e3d9ac6f3b5c3bed06116ec56b36 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 8a65551d4ae..86be7538eef 100644 --- a/mod/quiz/tests/backup/repeated_restore_test.php +++ b/mod/quiz/tests/backup/repeated_restore_test.php @@ -550,6 +550,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);