You are here

public function SmsRulesWebTestCase::drupalCreateAdminUser in SMS Framework 7

Function that creates a user with the administrator role.

1 call to SmsRulesWebTestCase::drupalCreateAdminUser()
SmsContainsKeywordConditionTestCase::testSmsContainsKeywordCondition in tests/sms.rules.test
Tests whether the sms rules condition for sms contains keyword works as it is supposed to.

File

tests/sms.rules.test, line 11

Class

SmsRulesWebTestCase
Provides common helper methods for SMS Rules 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);
}