Browse files

Merge branch 'wip-MDL-38144-MOODLE_23_STABLE' of git://github.com/mar…

…inaglancy/moodle into MOODLE_23_STABLE
  • Loading branch information...
2 parents 65403fc + 7a3e11d commit a515bc1b585be9b08fe76059775645bd246e9e9e Sam Hemelryk committed Feb 26, 2013
Showing with 6 additions and 3 deletions.
  1. +0 −1 course/externallib.php
  2. +6 −2 course/tests/externallib_test.php
View
1 course/externallib.php
@@ -1254,7 +1254,6 @@ public static function create_categories($categories) {
$newcategory = new stdClass();
$newcategory->name = $category['name'];
$newcategory->parent = $category['parent'];
- $newcategory->sortorder = 999; // Same as in the course/editcategory.php .
// Format the description.
if (!empty($category['description'])) {
$newcategory->description = $category['description'];
View
8 course/tests/externallib_test.php
@@ -111,8 +111,12 @@ public function test_create_categories() {
$category2 = $DB->get_record('course_categories', array('id' => $category2->id));
$category3 = $DB->get_record('course_categories', array('id' => $category3->id));
- $this->assertGreaterThanOrEqual($category1->sortorder, $category3->sortorder);
- $this->assertGreaterThanOrEqual($category2->sortorder, $category3->sortorder);
+ // sortorder sequence (and sortorder) must be:
+ // category 1
+ // category 3
+ // category 2
+ $this->assertGreaterThan($category1->sortorder, $category3->sortorder);
+ $this->assertGreaterThan($category3->sortorder, $category2->sortorder);
// Call without required capability
$this->unassignUserCapability('moodle/category:manage', $contextid, $roleid);

0 comments on commit a515bc1

Please sign in to comment.