Merge branch 'MDL-50353-master' of git://github.com/jleyva/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 16 Sep 2015 21:15:59 +0000 (23:15 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 16 Sep 2015 21:15:59 +0000 (23:15 +0200)
mod/scorm/tests/externallib_test.php

index a0cf4a8..2a4106f 100644 (file)
@@ -429,7 +429,8 @@ class mod_scorm_external_testcase extends externallib_advanced_testcase {
 
         $trackids = $DB->get_records('scorm_scoes_track', array('userid' => $student->id, 'scoid' => $sco->id,
                                                                 'scormid' => $scorm->id, 'attempt' => 1));
-
-        $this->assertEquals(array_keys($trackids), $result['trackids']);
+        // We use asort here to prevent problems with ids ordering.
+        $expectedkeys = array_keys($trackids);
+        $this->assertEquals(asort($expectedkeys), asort($result['trackids']));
     }
 }