You are here

public function SmsTrackWebTestCase::drupalCreateAdminUser in SMS Framework 7

Function that creates a user with the administrator role.

1 call to SmsTrackWebTestCase::drupalCreateAdminUser()
SmsTrackArchiveTestCase::testArchiveWriteForSentMessages in modules/sms_track/tests/sms_track.test
Tests recording a message sent from one site user to another.

File

modules/sms_track/tests/sms_track.test, line 11

Class

SmsTrackWebTestCase
Provides common helper methods for SMS Track module tests.

Code

public function drupalCreateAdminUser(array $permissions = array(
  'receive sms',
  'edit own sms number',
)) {
  $roles = user_roles();
  $index = array_search('administrator', $roles);
  $user = $this
    ->drupalCreateUser($permissions);
  $user->roles[$index] = 'administrator';
  return user_save($user);
}