You are here

public function UIFTestCaseFieldFields::testUIFImportWithFieldFieldsUnsuccessful in User Import Framework 7

Test unknown field.

File

./uif.test, line 328
UIF test code.

Class

UIFTestCaseFieldFields
Test import with Field module fields.

Code

public function testUIFImportWithFieldFieldsUnsuccessful() {
  $this
    ->drupalLogin($this->admin_user);
  $edit = array();
  $edit['fields[_add_new_field][label]'] = 'First name';
  $edit['fields[_add_new_field][field_name]'] = 'first_name';
  $edit['fields[_add_new_field][type]'] = 'text';
  $edit['fields[_add_new_field][widget_type]'] = 'text_textfield';
  $this
    ->drupalPost('admin/config/people/accounts/fields', $edit, t('Save'));
  $this
    ->assertText(t('These settings apply to the @label field everywhere it is used.', array(
    '@label' => $edit['fields[_add_new_field][label]'],
  )));
  $this
    ->drupalLogin($this->import_user);
  $edit = array();
  $edit['files[user_upload]'] = DRUPAL_ROOT . '/' . drupal_get_path('module', 'uif') . '/test_data/test_fields_2_invalid_data.csv';
  $this
    ->drupalPost('admin/people/uif', $edit, t('Next'));
  $this
    ->assertText(t('Unknown column last_name in the import file', array()));
}