protected function PBTKernelTestBase::createCurrentUser in Permissions by Term 8.2
Same name and namespace in other branches
- 8 tests/src/Kernel/PBTKernelTestBase.php \Drupal\Tests\permissions_by_term\Kernel\PBTKernelTestBase::createCurrentUser()
1 call to PBTKernelTestBase::createCurrentUser()
- PBTKernelTestBase::setUp in tests/
src/ Kernel/ PBTKernelTestBase.php
File
- tests/
src/ Kernel/ PBTKernelTestBase.php, line 133
Class
- PBTKernelTestBase
- Class PBTKernelTestBase
Namespace
Drupal\Tests\permissions_by_term\KernelCode
protected function createCurrentUser() : void {
$testUser = User::create([
'uid' => 2,
'name' => 'foobar',
'mail' => 'foobar@example.com',
]);
$testUser
->save();
\Drupal::service('current_user')
->setAccount($testUser);
}