Beispiel #1
0
 /**
  * Validate that the API call for removing a custom profile field from the
  * export works as expected
  */
 public function test_version1exportdeletesfield()
 {
     global $CFG, $DB;
     $file = get_plugin_directory('dhexport', 'version1') . '/lib.php';
     require_once $file;
     // Set up the category and field, along with the export mapping.
     $categoryid = $this->create_custom_field_category();
     $fieldid = $this->create_profile_field('rliptext', 'text', $categoryid);
     $this->create_field_mapping($fieldid);
     // Verify setup.
     $this->assert_record_exists(RLIPEXPORT_VERSION1_FIELD_TABLE, array('fieldid' => $fieldid));
     // Remove the field from the export.
     $id = $DB->get_field(RLIPEXPORT_VERSION1_FIELD_TABLE, 'id', array('fieldid' => $fieldid));
     rlipexport_version1_config::delete_field_from_export($id);
     // Validation.
     $exists = $DB->record_exists(RLIPEXPORT_VERSION1_FIELD_TABLE, array('fieldid' => $fieldid));
     $this->assertEquals($exists, false);
 }