You are here

public function BiblioWebTestCase::getUser in Bibliography Module 7

Return a test user.

1 call to BiblioWebTestCase::getUser()
BiblioContributorWebTestCase::testBiblioUpdateContributors in tests/BiblioContributorWebTestCase.test

File

tests/BiblioWebTestCase.test, line 70

Class

BiblioWebTestCase
Base class used by other tests.

Code

public function getUser($type) {
  if (isset($users[$type])) {
    return $users[$type];
  }
  switch ($type) {
    case 'access biblio content':
      $users[$type] = $this
        ->drupalCreateUser(array(
        'access biblio content',
      ));
      break;
    case 'administer biblio':
      $users[$type] = $this
        ->drupalCreateUser(array(
        'administer biblio',
        'access biblio content',
      ));
      break;
  }
  return isset($users[$type]) ? $users[$type] : NULL;
}