Skip to content
Snippets Groups Projects
Commit 1fcbbff8 authored by catch's avatar catch
Browse files

Issue #2254199 by smustgrave, sun, vacho, quietone, marvil07: Fix test...

Issue #2254199 by smustgrave, sun, vacho, quietone, marvil07: Fix test performance of Drupal\system\Tests\Menu\BreadcrumbTest
parent 762fcae9
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,14 @@ class BreadcrumbTest extends BrowserTestBase { ...@@ -23,7 +23,14 @@ class BreadcrumbTest extends BrowserTestBase {
* *
* @var array * @var array
*/ */
protected static $modules = ['menu_test', 'block']; protected static $modules = [
'block',
'dblog',
'field_ui',
'filter_test',
'menu_test',
'olivero_test',
];
/** /**
* An administrative user. * An administrative user.
...@@ -40,11 +47,9 @@ class BreadcrumbTest extends BrowserTestBase { ...@@ -40,11 +47,9 @@ class BreadcrumbTest extends BrowserTestBase {
protected $webUser; protected $webUser;
/** /**
* Test paths in the Standard profile. * {@inheritdoc}
*
* @var string
*/ */
protected $profile = 'standard'; protected $defaultTheme = 'olivero';
/** /**
* {@inheritdoc} * {@inheritdoc}
...@@ -52,6 +57,11 @@ class BreadcrumbTest extends BrowserTestBase { ...@@ -52,6 +57,11 @@ class BreadcrumbTest extends BrowserTestBase {
protected function setUp(): void { protected function setUp(): void {
parent::setUp(); 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()); $perms = array_keys(\Drupal::service('user.permissions')->getPermissions());
$this->adminUser = $this->drupalCreateUser($perms); $this->adminUser = $this->drupalCreateUser($perms);
$this->drupalLogin($this->adminUser); $this->drupalLogin($this->adminUser);
...@@ -156,14 +166,12 @@ public function testBreadCrumbs() { ...@@ -156,14 +166,12 @@ public function testBreadCrumbs() {
$this->assertBreadcrumb("admin/config/content/formats/manage/$format_id/disable", $trail); $this->assertBreadcrumb("admin/config/content/formats/manage/$format_id/disable", $trail);
// Verify node breadcrumbs (without menu link). // Verify node breadcrumbs (without menu link).
$node1 = $this->drupalCreateNode(); $node1 = $this->drupalCreateNode(['type' => $type]);
$nid1 = $node1->id(); $nid1 = $node1->id();
$trail = $home; $trail = $home;
$this->assertBreadcrumb("node/$nid1", $trail); $this->assertBreadcrumb("node/$nid1", $trail);
// Also verify that the node does not appear elsewhere (e.g., menu trees). // Also verify that the node does not appear elsewhere (e.g., menu trees).
$this->assertSession()->linkNotExists($node1->getTitle()); $this->assertSession()->linkNotExists($node1->getTitle());
// Also verify that the node does not appear elsewhere (e.g., menu trees).
$this->assertSession()->linkNotExists($node1->getTitle());
$trail += [ $trail += [
"node/$nid1" => $node1->getTitle(), "node/$nid1" => $node1->getTitle(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment