You are here

class UserImportBasicsTestCase in User Import 8

Same name and namespace in other branches
  1. 6.4 user_import.test \UserImportBasicsTestCase
  2. 6.2 user_import.test \UserImportBasicsTestCase
  3. 7.3 user_import.test \UserImportBasicsTestCase
  4. 7 user_import.test \UserImportBasicsTestCase
  5. 7.2 user_import.test \UserImportBasicsTestCase

User Import module base test class.

Hierarchy

Expanded class hierarchy of UserImportBasicsTestCase

File

./user_import.test, line 134

View source
class UserImportBasicsTestCase extends UserImportWebTestCase {
  public static function getInfo() {
    return array(
      'name' => 'Import Users (Basics)',
      'description' => 'Import users from a CSV file, test basic functions.',
      'group' => 'User Import',
    );
  }
  function setUp() {
    parent::setUp(array(
      'user_import',
    ));
    $this->admin_user = $this
      ->drupalCreateUser(array(
      'administer users',
      'access administration pages',
      'access overlay',
    ));
    $this->user_importer = $this
      ->drupalCreateUser(array(
      'import users',
    ));
  }

  /**
   *  User with right permissions creates import (with new settings)
   *  - test core functions
   */
  function testCreateImport() {

    // Prepare a user to do testing
    $this
      ->drupalLogin($this->user_importer);

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

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

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
UserImportBasicsTestCase::getInfo public static function
UserImportBasicsTestCase::setUp function
UserImportBasicsTestCase::testCreateImport function User with right permissions creates import (with new settings)
UserImportWebTestCase::$admin_user protected property
UserImportWebTestCase::$user_importer protected property
UserImportWebTestCase::checkAccountsExist function
UserImportWebTestCase::importID function Store import ID
UserImportWebTestCase::settingsEmailMatch function
UserImportWebTestCase::settingsFileSelect function Select CSV file (the included example file)
UserImportWebTestCase::settingsIgnoreFirstLine function
UserImportWebTestCase::tearDown function SimpleTest core method: code run after each and every test method.
UserImportWebTestCase::usersList function List of users (email addresses) being imported To Do - Generate this dynamically, bearing in mind it could be used for stress testing