You are here

protected function SmsFrameworkUserActiveHoursServiceTest::createUser in SMS Framework 8

Same name and namespace in other branches
  1. 2.x modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserActiveHoursServiceTest::createUser()
  2. 2.1.x modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserActiveHoursServiceTest::createUser()

Creates a user.

Parameters

array $values: Optional settings to add to user.

Return value

\Drupal\user\UserInterface A saved user entity.

11 calls to SmsFrameworkUserActiveHoursServiceTest::createUser()
SmsFrameworkUserActiveHoursServiceTest::testDelaySmsMessage in modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php
Tests delay was applied to a SMS message.
SmsFrameworkUserActiveHoursServiceTest::testDelaySmsMessageNotAutomated in modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php
Tests delay was not applied to a SMS message if it is tagged as automated.
SmsFrameworkUserActiveHoursServiceTest::testFindNextTimeNoRanges in modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php
Test no next time when no ranges are set.
SmsFrameworkUserActiveHoursServiceTest::testFindNextTimeSameDay in modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php
Test getting the range for today when within todays range.
SmsFrameworkUserActiveHoursServiceTest::testFindNextTimeSameDayOutOfHours in modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php
Test getting a range for next day when out of hours when a range was today.

... See full list

File

modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php, line 291

Class

SmsFrameworkUserActiveHoursServiceTest
Tests active hours service.

Namespace

Drupal\Tests\sms_user\Kernel

Code

protected function createUser(array $values = []) {
  $user = User::create([
    'uid' => 1,
    'name' => $this
      ->randomMachineName(),
  ] + $values);

  // Need to activate so when DER does entity validation it is included by the
  // UserSelection plugin.
  $user
    ->activate();
  $user
    ->save();
  return $user;
}