protected function UserEntityReferenceTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php \Drupal\Tests\user\Kernel\UserEntityReferenceTest::setUp()
Overrides EntityKernelTestBase::setUp
File
- core/
modules/ user/ tests/ src/ Kernel/ UserEntityReferenceTest.php, line 36
Class
- UserEntityReferenceTest
- Tests the user reference field functionality.
Namespace
Drupal\Tests\user\KernelCode
protected function setUp() : void {
parent::setUp();
$this->role1 = Role::create([
'id' => strtolower($this
->randomMachineName(8)),
'label' => $this
->randomMachineName(8),
]);
$this->role1
->save();
$this->role2 = Role::create([
'id' => strtolower($this
->randomMachineName(8)),
'label' => $this
->randomMachineName(8),
]);
$this->role2
->save();
$this
->createEntityReferenceField('user', 'user', 'user_reference', 'User reference', 'user');
}