You are here

function WorkbenchAccessTestCase::createWorkbenchAccessUsers in Workbench Access 7

Helper function to create users.

4 calls to WorkbenchAccessTestCase::createWorkbenchAccessUsers()
WorkbenchAccessBaseTestCase::testWorkbenchAccessInstall in tests/workbench_access.test
WorkbenchAccessMenuTestCase::testWorkbenchAccessMenu in tests/workbench_access.test
WorkbenchAccessRoleTestCase::testWorkbenchAccessRoles in tests/workbench_access.test
WorkbenchAccessTaxonomyTestCase::testWorkbenchAccessTaxonomy in tests/workbench_access.test

File

tests/workbench_access.test, line 46
Test file for Workbench Access.

Class

WorkbenchAccessTestCase
@file Test file for Workbench Access.

Code

function createWorkbenchAccessUsers($count = 10) {
  for ($i = 0; $i < $count; $i++) {

    // Using drupalCreateUser runs tests we don't want.
    $edit = array(
      'name' => $this
        ->randomName(32),
      'mail' => $this
        ->randomName(32) . '@example.com',
      'roles' => drupal_map_assoc(array(
        DRUPAL_AUTHENTICATED_RID,
        $this->editor_role,
      )),
      'status' => 1,
      'pass' => 'fubar',
    );
    $this->user_list[] = user_save(NULL, $edit);
  }
}