protected function EntityReferenceSelectionSortTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php \Drupal\KernelTests\Core\Entity\EntityReferenceSelection\EntityReferenceSelectionSortTest::setUp()
Overrides EntityKernelTestBase::setUp
File
- core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityReferenceSelection/ EntityReferenceSelectionSortTest.php, line 26
Class
- EntityReferenceSelectionSortTest
- Tests sorting referenced items.
Namespace
Drupal\KernelTests\Core\Entity\EntityReferenceSelectionCode
protected function setUp() : void {
parent::setUp();
// Create an Article node type.
$article = NodeType::create([
'type' => 'article',
]);
$article
->save();
// Test as a non-admin.
$normal_user = $this
->createUser([], [
'access content',
]);
\Drupal::currentUser()
->setAccount($normal_user);
}