Merge branch 'w47_MDL-36547_m24_sectiongen' of git://github.com/skodak/moodle
This commit is contained in:
@@ -83,6 +83,7 @@ abstract class phpunit_module_generator {
|
||||
|
||||
$modulename = $this->get_modulename();
|
||||
$sectionnum = isset($options['section']) ? $options['section'] : 0;
|
||||
unset($options['section']); // Prevent confusion, it would be overridden later in course_add_cm_to_section() anyway.
|
||||
|
||||
$cm = new stdClass();
|
||||
$cm->course = $courseid;
|
||||
|
||||
@@ -100,6 +100,13 @@ class core_phpunit_generator_testcase extends advanced_testcase {
|
||||
|
||||
$page = $generator->create_module('page', array('course'=>$SITE->id));
|
||||
$this->assertNotEmpty($page);
|
||||
$cm = get_coursemodule_from_instance('page', $page->id, $SITE->id, true);
|
||||
$this->assertEquals(0, $cm->sectionnum);
|
||||
|
||||
$page = $generator->create_module('page', array('course'=>$SITE->id), array('section'=>3));
|
||||
$this->assertNotEmpty($page);
|
||||
$cm = get_coursemodule_from_instance('page', $page->id, $SITE->id, true);
|
||||
$this->assertEquals(3, $cm->sectionnum);
|
||||
}
|
||||
|
||||
public function test_create_block() {
|
||||
|
||||
Reference in New Issue
Block a user