MDL-42858 Course Management: Update phpunit test for core_course_management_helper_test

This commit is contained in:
rwijaya
2013-11-25 15:40:07 +08:00
committed by Dan Poltawski
parent 72cf8c6ca3
commit bb68dfc002
+4 -4
View File
@@ -191,8 +191,8 @@ class core_course_management_helper_test extends advanced_testcase {
$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 @@ class core_course_management_helper_test extends advanced_testcase {
$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);