You are here

function UserImportProfile::testCreateImport in User Import 5

Same name and namespace in other branches
  1. 8 tests/user_import_profile.test \UserImportProfile::testCreateImport()

* User with right permissions creates import (with new settings) * - test import of user data into Profile module

File

tests/user_import_profile.test, line 20

Class

UserImportProfile
Test import of user data into Profile module

Code

function testCreateImport() {
  $this
    ->drupalModuleEnable('profile');
  $this
    ->drupalLoginUser($this->admin_user);
  $this
    ->profileFieldsCreate();

  // Prepare a user to do testing
  $this
    ->get('logout');

  // log out first
  $this
    ->drupalLoginUser($this->user_importer);

  // Select CSV file (the included example file)
  $this
    ->settingsFileSelect();

  // import settings
  $this
    ->importID($this
    ->getUrl());

  // store import ID for later
  $settings = array();
  $this
    ->settingsEmailMatch($settings);
  $this
    ->settingsProfileMatch($settings);
  $this
    ->settingsIgnoreFirstLine($settings);
  $this
    ->drupalPostRequest($this
    ->getUrl(), $settings, 'Import');

  // check if users have been imported
  $this
    ->checkProfileExist();
}