From b4126b0c8b6df60865f99f724a52fd8a39a26d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Wed, 14 Nov 2012 19:00:55 +0100 Subject: [PATCH] MDL-36547 add test for section number when generating modules --- lib/phpunit/tests/generator_test.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/phpunit/tests/generator_test.php b/lib/phpunit/tests/generator_test.php index 1a3efc34aea..0b47456f6ab 100644 --- a/lib/phpunit/tests/generator_test.php +++ b/lib/phpunit/tests/generator_test.php @@ -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() {