function BulkFormAccessTest::setUp

Same name in other branches
  1. 9 core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php \Drupal\Tests\node\Functional\Views\BulkFormAccessTest::setUp()
  2. 8.9.x core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php \Drupal\Tests\node\Functional\Views\BulkFormAccessTest::setUp()
  3. 10 core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php \Drupal\Tests\node\Functional\Views\BulkFormAccessTest::setUp()

Overrides NodeTestBase::setUp

File

core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php, line 48

Class

BulkFormAccessTest
Tests if entity access is respected on a node bulk operations form.

Namespace

Drupal\Tests\node\Functional\Views

Code

protected function setUp($import_test_views = TRUE, $modules = [
    'node_test_views',
]) : void {
    parent::setUp($import_test_views, $modules);
    // Create Article node type.
    $this->drupalCreateContentType([
        'type' => 'article',
        'name' => 'Article',
    ]);
    $this->accessHandler = \Drupal::entityTypeManager()->getAccessControlHandler('node');
    node_access_test_add_field(NodeType::load('article'));
    // After enabling a node access module, the access table has to be rebuild.
    node_access_rebuild();
    // Enable the private node feature of the node_access_test module.
    \Drupal::state()->set('node_access_test.private', TRUE);
}

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