You are here

public function DraggableviewsTest::setUp in DraggableViews 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/DraggableviewsTest.php \Drupal\Tests\draggableviews\Functional\DraggableviewsTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/DraggableviewsTest.php, line 35

Class

DraggableviewsTest
Tests sortability of Draggableviewws.

Namespace

Drupal\Tests\draggableviews\Functional

Code

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

  // Create users.
  $this->adminUser = $this
    ->drupalCreateUser([
    'access administration pages',
    'view the administration theme',
    'administer permissions',
    'administer nodes',
    'administer content types',
    'access draggableviews',
  ]);
  $this->authUser = $this
    ->drupalCreateUser([], 'authuser');

  // Gather the test data.
  $dataContent = $this
    ->providerTestDataContent();

  // Create nodes.
  foreach ($dataContent as $datumContent) {
    $node = $this
      ->drupalCreateNode([
      'type' => 'draggableviews_demo',
      'title' => $datumContent[0],
    ]);
    $node
      ->save();
  }
}