You are here

protected function ContextualDynamicContextTest::setUp in Drupal 10

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

File

core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php, line 60

Class

ContextualDynamicContextTest
Tests if contextual links are showing on the front page depending on permissions.

Namespace

Drupal\Tests\contextual\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->drupalCreateContentType([
    'type' => 'page',
    'name' => 'Basic page',
  ]);
  $this
    ->drupalCreateContentType([
    'type' => 'article',
    'name' => 'Article',
  ]);
  ConfigurableLanguage::createFromLangcode('it')
    ->save();
  $this
    ->rebuildContainer();
  $this->editorUser = $this
    ->drupalCreateUser([
    'access content',
    'access contextual links',
    'edit any article content',
  ]);
  $this->authenticatedUser = $this
    ->drupalCreateUser([
    'access content',
    'access contextual links',
  ]);
  $this->anonymousUser = $this
    ->drupalCreateUser([
    'access content',
  ]);
}