You are here

protected function NodeAccessLanguageFallbackTest::setUp in Drupal 9

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

Overrides NodeTestBase::setUp

File

core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php, line 33

Class

NodeAccessLanguageFallbackTest
Tests that the node_access system stores the proper fallback marker.

Namespace

Drupal\Tests\node\Functional

Code

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

  // After enabling a node access module, the {node_access} table has to be
  // rebuilt.
  node_access_rebuild();

  // Add Hungarian, Catalan, and Afrikaans.
  ConfigurableLanguage::createFromLangcode('hu')
    ->save();
  ConfigurableLanguage::createFromLangcode('ca')
    ->save();
  ConfigurableLanguage::createFromLangcode('af')
    ->save();

  // Enable content translation for the current entity type.
  \Drupal::service('content_translation.manager')
    ->setEnabled('node', 'page', TRUE);
}