You are here

protected function EntityReferenceSelectionSortTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php \Drupal\KernelTests\Core\Entity\EntityReferenceSelection\EntityReferenceSelectionSortTest::setUp()
  2. 9 core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php \Drupal\KernelTests\Core\Entity\EntityReferenceSelection\EntityReferenceSelectionSortTest::setUp()

File

core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php, line 26

Class

EntityReferenceSelectionSortTest
Tests sorting referenced items.

Namespace

Drupal\KernelTests\Core\Entity\EntityReferenceSelection

Code

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);
}