public function test_upgrade_offline_seplment()
 {
     global $DB, $CFG;
     $commentconfig = false;
     if (!empty($CFG->usecomments)) {
         $commentconfig = $CFG->usecomments;
     }
     $CFG->usecomments = false;
     $this->setUser($this->editingteachers[0]);
     $generator = $this->getDataGenerator()->get_plugin_generator('mod_seplment');
     $params = array('course' => $this->course->id, 'seplmenttype' => 'offline');
     $seplment = $generator->create_instance($params);
     $this->setAdminUser();
     $log = '';
     $upgrader = new sepl_upgrade_manager();
     $this->assertTrue($upgrader->upgrade_seplment($seplment->id, $log));
     $record = $DB->get_record('sepl', array('course' => $this->course->id));
     $cm = get_coursemodule_from_instance('sepl', $record->id);
     $context = context_module::instance($cm->id);
     $sepl = new sepl($context, $cm, $this->course);
     $plugin = $sepl->get_submission_plugin_by_type('onlinetext');
     $this->assertEmpty($plugin->is_enabled());
     $plugin = $sepl->get_submission_plugin_by_type('comments');
     $this->assertEmpty($plugin->is_enabled());
     $plugin = $sepl->get_submission_plugin_by_type('file');
     $this->assertEmpty($plugin->is_enabled());
     $plugin = $sepl->get_feedback_plugin_by_type('comments');
     $this->assertNotEmpty($plugin->is_enabled());
     $plugin = $sepl->get_feedback_plugin_by_type('file');
     $this->assertEmpty($plugin->is_enabled());
     $plugin = $sepl->get_feedback_plugin_by_type('offline');
     $this->assertEmpty($plugin->is_enabled());
     $CFG->usecomments = $commentconfig;
     course_delete_module($cm->id);
 }