function BreadcrumbTest::setUp
Same name in other branches
- 9 core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php \Drupal\Tests\system\Functional\Menu\BreadcrumbTest::setUp()
- 8.9.x core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php \Drupal\Tests\system\Functional\Menu\BreadcrumbTest::setUp()
- 10 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 57
Class
- BreadcrumbTest
- Tests breadcrumbs functionality.
Namespace
Drupal\Tests\system\Functional\MenuCode
protected function setUp() : void {
parent::setUp();
// Install 'claro' and configure it as administrative theme.
$this->container
->get('theme_installer')
->install([
'claro',
]);
$this->config('system.theme')
->set('admin', 'claro')
->save();
$this->config('system.site')
->set('page.front', '/node')
->save();
$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.