MDL-38708 Changed test to be more accurate
authorMarina Glancy <marina@moodle.com>
Thu, 4 Apr 2013 23:52:09 +0000 (10:52 +1100)
committerMarina Glancy <marina@moodle.com>
Thu, 4 Apr 2013 23:52:09 +0000 (10:52 +1100)
course/tests/courselib_test.php

index 9d08906..74db189 100644 (file)
@@ -582,12 +582,12 @@ class courselib_testcase extends advanced_testcase {
         $course->newsitems = 0;
         $course->numsections = 5;
         $course->category = $defaultcategory;
+        $original = (array) $course;
 
         $created = create_course($course);
         $context = context_course::instance($created->id);
 
         // Compare original and created.
-        $original = (array) $course;
         $this->assertEquals($original, array_intersect_key((array) $created, $original));
 
         // Ensure default section is created.