function EntityReferenceSelectionSortTest::setUp

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php \Drupal\KernelTests\Core\Entity\EntityReferenceSelection\EntityReferenceSelectionSortTest::setUp()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php \Drupal\KernelTests\Core\Entity\EntityReferenceSelection\EntityReferenceSelectionSortTest::setUp()
  3. 11.x 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 29

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.