Merge branch 'w47_MDL-36547_m24_sectiongen' of git://github.com/skodak/moodle

This commit is contained in:
Dan Poltawski
2012-11-21 15:26:15 +08:00
3 changed files with 21 additions and 7 deletions
+1
View File
@@ -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;
+7
View File
@@ -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() {