You are here

protected function EntityReferenceSelectionSortTest::setUp in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php \Drupal\system\Tests\Entity\EntityReferenceSelection\EntityReferenceSelectionSortTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides EntityUnitTestBase::setUp

File

core/modules/system/src/Tests/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php, line 29
Contains \Drupal\system\Tests\Entity\EntityReferenceSelection\EntityReferenceSelectionSortTest.

Class

EntityReferenceSelectionSortTest
Tests sorting referenced items.

Namespace

Drupal\system\Tests\Entity\EntityReferenceSelection

Code

protected function setUp() {
  parent::setUp();

  // Create an Article node type.
  $article = NodeType::create(array(
    'type' => 'article',
  ));
  $article
    ->save();

  // Test as a non-admin.
  $normal_user = $this
    ->createUser(array(), array(
    'access content',
  ));
  \Drupal::currentUser()
    ->setAccount($normal_user);
}