Beispiel #1
0
 /**
  * Validate that the API call for updating the header text for a single
  * configured custom profile field works as expected
  */
 public function test_version1exportupdatesheader()
 {
     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);
     // Update the header.
     $id = $DB->get_field(RLIPEXPORT_VERSION1_FIELD_TABLE, 'id', array('fieldid' => $fieldid));
     rlipexport_version1_config::update_field_header($id, 'Updatedvalue');
     // Validation.
     $this->assert_record_exists(RLIPEXPORT_VERSION1_FIELD_TABLE, array('fieldid' => $fieldid, 'header' => 'Updatedvalue'));
 }