protected function CourierSystemTest::createUser in Courier 2.x
Same name and namespace in other branches
- 8 courier_system/tests/src/Kernel/CourierSystemTest.php \Drupal\Tests\courier_system\Kernel\CourierSystemTest::createUser()
Create a random user for testing.
Return value
\Drupal\user\UserInterface A user entity.
2 calls to CourierSystemTest::createUser()
- CourierSystemTest::testNonOverride in courier_system/
tests/ src/ Kernel/ CourierSystemTest.php - Test courier system override is off.
- CourierSystemTest::testOverride in courier_system/
tests/ src/ Kernel/ CourierSystemTest.php - Test courier system override is on.
File
- courier_system/
tests/ src/ Kernel/ CourierSystemTest.php, line 133
Class
- CourierSystemTest
- Tests Courier system.
Namespace
Drupal\Tests\courier_system\KernelCode
protected function createUser() {
$mail = $this
->randomMachineName() . '@' . $this
->randomMachineName();
$account = User::create([
'name' => $this
->randomMachineName(),
'mail' => $mail,
]);
$account
->save();
return $account;
}