function NodeAccessTest::setUp
Sets the test up.
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\FunctionalCode
protected function setUp() : void {
  parent::setUp();
  $this->drupalLogin($this->adminUser);
  $this->createContentTypeFromUi('Moderated content', 'moderated_content', FALSE);
  // Ensure the statically cached entity bundle info is aware of the content
  // type that was just created in the UI.
  $this->container
    ->get('entity_type.bundle.info')
    ->clearCachedBundles();
  $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.