| Línea 30... |
Línea 30... |
| 30 |
*
|
30 |
*
|
| 31 |
* @copyright 2013 The Open University
|
31 |
* @copyright 2013 The Open University
|
| 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 generator_test extends \advanced_testcase {
|
34 |
class generator_test extends \advanced_testcase {
|
| 35 |
public function test_create() {
|
35 |
public function test_create(): void {
|
| 36 |
global $DB;
|
36 |
global $DB;
|
| Línea 37... |
Línea 37... |
| 37 |
|
37 |
|
| 38 |
$this->resetAfterTest();
|
38 |
$this->resetAfterTest();
|
| Línea 48... |
Línea 48... |
| 48 |
$cat = $generator->create_question_category(['name' => 'My category', 'sortorder' => 1]);
|
48 |
$cat = $generator->create_question_category(['name' => 'My category', 'sortorder' => 1]);
|
| 49 |
$this->assertSame('My category', $cat->name);
|
49 |
$this->assertSame('My category', $cat->name);
|
| 50 |
$this->assertSame(1, $cat->sortorder);
|
50 |
$this->assertSame(1, $cat->sortorder);
|
| 51 |
}
|
51 |
}
|
| Línea 52... |
Línea 52... |
| 52 |
|
52 |
|
| 53 |
public function test_idnumbers_in_categories_and_questions() {
|
53 |
public function test_idnumbers_in_categories_and_questions(): void {
|
| 54 |
$this->resetAfterTest();
|
54 |
$this->resetAfterTest();
|
| 55 |
$generator = $this->getDataGenerator()->get_plugin_generator('core_question');
|
55 |
$generator = $this->getDataGenerator()->get_plugin_generator('core_question');
|
| 56 |
list($category, $course, $qcat, $questions) = $generator->setup_course_and_questions();
|
56 |
list($category, $course, $qcat, $questions) = $generator->setup_course_and_questions();
|
| 57 |
// Check default idnumbers in question_category and questions.
|
57 |
// Check default idnumbers in question_category and questions.
|