function PathPluginTest::setUp

Same name and namespace in other branches
  1. 11.x core/modules/node/tests/src/Kernel/Views/PathPluginTest.php \Drupal\Tests\node\Kernel\Views\PathPluginTest::setUp()

File

core/modules/node/tests/src/Kernel/Views/PathPluginTest.php, line 50

Class

PathPluginTest
Tests the node row plugin.

Namespace

Drupal\Tests\node\Kernel\Views

Code

protected function setUp($import_test_views = TRUE) : void {
  parent::setUp($import_test_views);
  $this->installEntitySchema('user');
  $this->installEntitySchema('node');
  $this->installSchema('node', [
    'node_access',
  ]);
  ViewTestData::createTestViews(static::class, [
    'node_test_views',
  ]);
  \Drupal::currentUser()->setAccount($this->createUser([
    'access content',
  ]));
  NodeType::create([
    'type' => 'article',
    'name' => 'Article',
  ])->save();
  // Create two nodes.
  for ($i = 0; $i < 2; $i++) {
    $this->nodes[] = $this->createNode([
      'type' => 'article',
    ]);
  }
}

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