mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch 'MDL-70321' of https://github.com/timhunt/moodle
This commit is contained in:
commit
9e12342aa5
@ -225,7 +225,8 @@ class core_question_backup_testcase extends advanced_testcase {
|
||||
// Create a question.
|
||||
$questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question');
|
||||
$questioncategory = $questiongenerator->create_question_category();
|
||||
$overrides = ['category' => $questioncategory->id, 'createdby' => $user->id, 'modifiedby' => $user->id];
|
||||
$overrides = ['name' => 'Test question', 'category' => $questioncategory->id,
|
||||
'createdby' => $user->id, 'modifiedby' => $user->id];
|
||||
$question = $questiongenerator->create_question('truefalse', null, $overrides);
|
||||
|
||||
// Create a quiz and a questions.
|
||||
@ -261,7 +262,7 @@ class core_question_backup_testcase extends advanced_testcase {
|
||||
$rc->destroy();
|
||||
|
||||
// Test the question author.
|
||||
$questions = $DB->get_records('question');
|
||||
$questions = $DB->get_records('question', ['name' => 'Test question']);
|
||||
$this->assertCount(1, $questions);
|
||||
$question3 = array_shift($questions);
|
||||
$this->assertEquals($user->id, $question3->createdby);
|
||||
@ -285,7 +286,8 @@ class core_question_backup_testcase extends advanced_testcase {
|
||||
// Create a question.
|
||||
$questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question');
|
||||
$questioncategory = $questiongenerator->create_question_category();
|
||||
$overrides = ['category' => $questioncategory->id, 'createdby' => $user->id, 'modifiedby' => $user->id];
|
||||
$overrides = ['name' => 'Test question', 'category' => $questioncategory->id,
|
||||
'createdby' => $user->id, 'modifiedby' => $user->id];
|
||||
$question = $questiongenerator->create_question('truefalse', null, $overrides);
|
||||
|
||||
// Create a quiz and a questions.
|
||||
@ -317,7 +319,7 @@ class core_question_backup_testcase extends advanced_testcase {
|
||||
$rc->destroy();
|
||||
|
||||
// Test the question author.
|
||||
$questions = $DB->get_records('question');
|
||||
$questions = $DB->get_records('question', ['name' => 'Test question']);
|
||||
$this->assertCount(1, $questions);
|
||||
$question = array_shift($questions);
|
||||
$this->assertEquals($user->id, $question->createdby);
|
||||
@ -341,7 +343,8 @@ class core_question_backup_testcase extends advanced_testcase {
|
||||
// Create a question.
|
||||
$questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question');
|
||||
$questioncategory = $questiongenerator->create_question_category();
|
||||
$overrides = ['category' => $questioncategory->id, 'createdby' => $user->id, 'modifiedby' => $user->id];
|
||||
$overrides = ['name' => 'Test question', 'category' => $questioncategory->id,
|
||||
'createdby' => $user->id, 'modifiedby' => $user->id];
|
||||
$question = $questiongenerator->create_question('truefalse', null, $overrides);
|
||||
|
||||
// Create a quiz and a questions.
|
||||
@ -376,7 +379,7 @@ class core_question_backup_testcase extends advanced_testcase {
|
||||
$rc->destroy();
|
||||
|
||||
// Test the question author.
|
||||
$questions = $DB->get_records('question');
|
||||
$questions = $DB->get_records('question', ['name' => 'Test question']);
|
||||
$this->assertCount(1, $questions);
|
||||
$question = array_shift($questions);
|
||||
$this->assertEquals($USER->id, $question->createdby);
|
||||
|
Loading…
x
Reference in New Issue
Block a user