function NodeAccessTest::setUp

Same name in this branch
  1. 9 core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php \Drupal\Tests\content_moderation\Kernel\NodeAccessTest::setUp()
Same name in other branches
  1. 8.9.x core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php \Drupal\Tests\content_moderation\Kernel\NodeAccessTest::setUp()
  2. 8.9.x core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php \Drupal\Tests\content_moderation\Functional\NodeAccessTest::setUp()
  3. 10 core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php \Drupal\Tests\content_moderation\Kernel\NodeAccessTest::setUp()
  4. 10 core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php \Drupal\Tests\content_moderation\Functional\NodeAccessTest::setUp()
  5. 11.x core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php \Drupal\Tests\content_moderation\Kernel\NodeAccessTest::setUp()
  6. 11.x core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php \Drupal\Tests\content_moderation\Functional\NodeAccessTest::setUp()

Overrides ModerationStateTestBase::setUp

File

core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php, line 53

Class

NodeAccessTest
Tests permission access control around nodes.

Namespace

Drupal\Tests\content_moderation\Functional

Code

protected function setUp() : void {
    parent::setUp();
    $this->drupalLogin($this->adminUser);
    $this->createContentTypeFromUi('Moderated content', 'moderated_content', FALSE);
    $this->grantUserPermissionToCreateContentOfType($this->adminUser, 'moderated_content');
    // Add the private field to the node type.
    node_access_test_add_field(NodeType::load('moderated_content'));
    // Rebuild permissions because hook_node_grants() is implemented by the
    // node_access_test_empty module.
    node_access_rebuild();
}

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