Browse files

MDL-42858 Course Management: Update phpunit test for core_course_mana…

…gement_helper_test
  • Loading branch information...
1 parent 72cf8c6 commit bb68dfc002ccfb8124095b152e6b6e533fd046d6 @rwijaya rwijaya committed with danpoltawski Nov 25, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 course/tests/management_helper_test.php
View
8 course/tests/management_helper_test.php
@@ -191,8 +191,8 @@ public function test_action_category_hide_and_show() {
$parentassignment->assign(CAP_PREVENT);
// Now we have capability on the category and subcategory but not the parent.
- // Try to mark the subcategory as visible. This shouldn't be possible because its parent is hidden.
- $this->assertFalse(\core_course\management\helper::action_category_show($subcategory));
+ // Try to mark the subcategory as visible. This should be possible although its parent is set to hidden.
+ $this->assertTrue(\core_course\management\helper::action_category_show($subcategory));
$cat = coursecat::get($category->id);
$subcat = coursecat::get($subcategory->id);
$course = $DB->get_record('course', array('id' => $course->id), 'id, visible, visibleold', MUST_EXIST);
@@ -348,8 +348,8 @@ public function test_action_category_hide_and_show_by_id() {
$parentassignment->assign(CAP_PREVENT);
// Now we have capability on the category and subcategory but not the parent.
- // Try to mark the subcategory as visible. This shouldn't be possible because its parent is hidden.
- $this->assertFalse(\core_course\management\helper::action_category_show($subcategory));
+ // Try to mark the subcategory as visible. This should be possible although its parent is set to hidden.
+ $this->assertTrue(\core_course\management\helper::action_category_show($subcategory));
$cat = coursecat::get($category->id);
$subcat = coursecat::get($subcategory->id);
$course = $DB->get_record('course', array('id' => $course->id), 'id, visible, visibleold', MUST_EXIST);

0 comments on commit bb68dfc

Please sign in to comment.