MDL-68757 questions: don't do output in low-level functions

This commit is contained in:
Tim Hunt 2020-05-18 13:09:24 +01:00
parent d85118369d
commit 4a45b7112c
7 changed files with 52 additions and 131 deletions

View file

@ -1653,11 +1653,8 @@ class core_course_courselib_testcase extends advanced_testcase {
case 'quiz':
$qgen = $this->getDataGenerator()->get_plugin_generator('core_question');
$qcat = $qgen->create_question_category(array('contextid' => $modcontext->id));
$questions = array(
$qgen->create_question('shortanswer', null, array('category' => $qcat->id)),
$qgen->create_question('shortanswer', null, array('category' => $qcat->id)),
);
$this->expectOutputRegex('/'.get_string('unusedcategorydeleted', 'question').'/');
$qgen->create_question('shortanswer', null, array('category' => $qcat->id));
$qgen->create_question('shortanswer', null, array('category' => $qcat->id));
break;
default:
break;