Browse files

MDL-36547 add test for section number when generating modules

  • Loading branch information...
1 parent 6548ce0 commit 996db2f7ac5ee7e68b13f3d2f0ad3f23a06fa65c @skodak skodak committed Nov 14, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/phpunit/tests/generator_test.php
View
7 lib/phpunit/tests/generator_test.php
@@ -88,6 +88,13 @@ public function test_create_module() {
$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() {

0 comments on commit 996db2f

Please sign in to comment.