You are here

protected function NodeQueryAlterTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/node/tests/src/Functional/NodeQueryAlterTest.php \Drupal\Tests\node\Functional\NodeQueryAlterTest::setUp()

Overrides NodeTestBase::setUp

File

core/modules/node/tests/src/Functional/NodeQueryAlterTest.php, line 36

Class

NodeQueryAlterTest
Tests that node access queries are properly altered by the node module.

Namespace

Drupal\Tests\node\Functional

Code

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

  // Create some content.
  $this
    ->drupalCreateNode();
  $this
    ->drupalCreateNode();
  $this
    ->drupalCreateNode();
  $this
    ->drupalCreateNode();

  // Create user with simple node access permission. The 'node test view'
  // permission is implemented and granted by the node_access_test module.
  $this->accessUser = $this
    ->drupalCreateUser([
    'access content overview',
    'access content',
    'node test view',
  ]);
  $this->noAccessUser = $this
    ->drupalCreateUser([
    'access content overview',
    'access content',
  ]);
  $this->noAccessUser2 = $this
    ->drupalCreateUser([
    'access content overview',
    'access content',
  ]);
}