function BreadcrumbTest::setUp

Same name in other branches
  1. 8.9.x core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php \Drupal\Tests\system\Functional\Menu\BreadcrumbTest::setUp()
  2. 10 core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php \Drupal\Tests\system\Functional\Menu\BreadcrumbTest::setUp()
  3. 11.x core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php \Drupal\Tests\system\Functional\Menu\BreadcrumbTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php, line 52

Class

BreadcrumbTest
Tests breadcrumbs functionality.

Namespace

Drupal\Tests\system\Functional\Menu

Code

protected function setUp() : void {
    parent::setUp();
    $perms = array_keys(\Drupal::service('user.permissions')->getPermissions());
    $this->adminUser = $this->drupalCreateUser($perms);
    $this->drupalLogin($this->adminUser);
    // This test puts menu links in the Tools menu and then tests for their
    // presence on the page, so we need to ensure that the Tools block will be
    // displayed in the admin theme and olivero.
    $this->drupalPlaceBlock('system_menu_block:tools', [
        'region' => 'content',
        'theme' => $this->config('system.theme')
            ->get('admin'),
    ]);
    $this->drupalPlaceBlock('system_menu_block:tools', [
        'region' => 'content',
        'theme' => 'olivero',
    ]);
}

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