Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 29... Línea 29...
29
 * @package    qbank_comment
29
 * @package    qbank_comment
30
 * @copyright  2021 Catalyst IT Australia Pty Ltd
30
 * @copyright  2021 Catalyst IT Australia Pty Ltd
31
 * @author     Matt Porritt <mattp@catalyst-au.net>
31
 * @author     Matt Porritt <mattp@catalyst-au.net>
32
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
33
 */
33
 */
34
class backup_test extends \advanced_testcase {
34
final class backup_test extends \advanced_testcase {
Línea 35... Línea 35...
35
 
35
 
36
    /**
36
    /**
37
     * @var array Data object for generating a question.
37
     * @var array Data object for generating a question.
38
     */
38
     */
Línea 72... Línea 72...
72
        $data->area = 'question';
72
        $data->area = 'question';
Línea 73... Línea 73...
73
 
73
 
74
        // Question initial set up.
74
        // Question initial set up.
75
        $this->category = $this->getDataGenerator()->create_category();
75
        $this->category = $this->getDataGenerator()->create_category();
-
 
76
        $this->course = $this->getDataGenerator()->create_course(['category' => $this->category->id]);
76
        $this->course = $this->getDataGenerator()->create_course(['category' => $this->category->id]);
77
        $qbank = self::getDataGenerator()->create_module('qbank', ['course' => $this->course->id]);
77
        $context = \context_coursecat::instance($this->category->id);
78
        $context = \context_module::instance($qbank->cmid);
78
        $this->qgen = $this->getDataGenerator()->get_plugin_generator('core_question');
79
        $this->qgen = $this->getDataGenerator()->get_plugin_generator('core_question');
Línea 79... Línea 80...
79
        $qcat = $this->qgen->create_question_category(['contextid' => $context->id]);
80
        $qcat = $this->qgen->create_question_category(['contextid' => $context->id]);
80
 
81