function remove_category_block_values($categoryid, $pluginname) { remove_category_plugin_values($categoryid, $pluginname, 'block'); }
public function test_remove_plugin_setting() { global $COURSE; // Setup. // Test Set. $COURSE->category = 2; set_context_module_settings($COURSE->category, 'assignment', array('visible' => 0)); $COURSE->category = 3; set_context_module_settings($COURSE->category, 'assignment', array('visible' => 0)); $COURSE->category = 2; remove_category_plugin_values($COURSE->category, 'assignment', 'modules'); $result = get_context_module_settings($COURSE->category, 'assignment'); $this->assertEquals($result->name, 'assignment'); $this->assertEquals($result->visible, 1); $COURSE->category = 3; $result = get_context_module_settings($COURSE->category, 'assignment'); $this->assertEquals($result->name, 'assignment'); $this->assertEquals($result->visible, 0); $COURSE->category = 3; remove_category_plugin_values($COURSE->category, 'assignment', 'modules'); $result = get_context_module_settings($COURSE->category, 'assignment'); $this->assertEquals($result->name, 'assignment'); $this->assertEquals($result->visible, 1); // Teardown. }