MDL-35382 fix random course test failures
authorPetr Skoda <commits@skodak.org>
Sat, 6 Oct 2012 11:27:04 +0000 (13:27 +0200)
committerPetr Skoda <commits@skodak.org>
Sat, 6 Oct 2012 11:28:27 +0000 (13:28 +0200)
course/tests/courselib_test.php

index 42b8057..acf5963 100644 (file)
@@ -36,7 +36,7 @@ class courselib_testcase extends advanced_testcase {
         $course = $this->getDataGenerator()->create_course(array('numsections'=>10), array('createsections'=>true));
         $oldsections = array();
         $sections = array();
-        foreach ($DB->get_records('course_sections', array('course'=>$course->id)) as $section) {
+        foreach ($DB->get_records('course_sections', array('course'=>$course->id), 'id') as $section) {
             $oldsections[$section->section] = $section->id;
             $sections[$section->id] = $section->section;
         }