diff --git a/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php b/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php index 7b238ef..fd0dc7c 100644 --- a/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php +++ b/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php @@ -99,9 +99,9 @@ protected function getBreadcrumbParts() { if (!empty($elements)) { foreach ($elements as $element) { $parts[] = [ - 'text' => $element->getHtml(), - 'href' => $element->getHtml(), - 'title' => $element->getHtml(), + 'text' => $element->getText(), + 'href' => $element->getAttribute('href'), + 'title' => $element->getAttribute('title'), ]; } } diff --git a/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php b/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php index 4d8de05..e9142dc 100644 --- a/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php +++ b/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php @@ -361,17 +361,17 @@ public function testBreadCrumbs() { // user is not able to access "Administer". $trail = $home; $this->assertBreadcrumb('admin', $trail, t('Access denied')); - $this->assertResponse(403); + $this->assertSession()->statusCodeEquals(403); // Since the 'admin' path is not accessible, we still expect only the Home // link. $this->assertBreadcrumb('admin/reports', $trail, t('Reports')); - $this->assertNoResponse(403); + $this->assertSession()->statusCodeNotEquals(403); // Since the Reports page is accessible, that will show. $trail += ['admin/reports' => t('Reports')]; $this->assertBreadcrumb('admin/reports/dblog', $trail, t('Recent log messages')); - $this->assertNoResponse(403); + $this->assertSession()->statusCodeNotEquals(403); // Ensure that the breadcrumb is safe against XSS. $this->drupalGet('menu-test/breadcrumb1/breadcrumb2/breadcrumb3'); diff --git a/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php b/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php index a6ea059..12a157d 100644 --- a/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php +++ b/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php @@ -144,15 +144,15 @@ public function testPluginLocalTask() { $result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]/a'); $this->assertEqual(1, count($result), 'There is just a single active tab.'); - $this->assertEqual('Settings', $result[0]->getText(), 'The settings tab is active.'); + $this->assertEqual('Settings(active tab)', $result[0]->getText(), 'The settings tab is active.'); $this->drupalGet(Url::fromRoute('menu_test.local_task_test_tasks_settings_sub1')); $this->assertLocalTasks($sub_tasks, 1); $result = $this->xpath('//ul[contains(@class, "tabs")]//a[contains(@class, "active")]'); $this->assertEqual(2, count($result), 'There are tabs active on both levels.'); - $this->assertEqual('Settings', $result[0]->getText(), 'The settings tab is active.'); - $this->assertEqual('Dynamic title for TestTasksSettingsSub1', $result[1]->getText(), 'The sub1 tab is active.'); + $this->assertEqual('Settings(active tab)', $result[0]->getText(), 'The settings tab is active.'); + $this->assertEqual('Dynamic title for TestTasksSettingsSub1(active tab)', $result[1]->getText(), 'The sub1 tab is active.'); $this->assertCacheTag('kittens:ragdoll'); $this->assertCacheTag('kittens:dwarf-cat'); @@ -162,8 +162,8 @@ public function testPluginLocalTask() { $result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]'); $this->assertEqual(2, count($result), 'There are tabs active on both levels.'); - $this->assertEqual('Settings(active tab)', $result[0]->find('a')->getText(), 'The settings tab is active.'); - $this->assertEqual('Derive 1(active tab)', $result[1]->find('a')->getText(), 'The derive1 tab is active.'); + $this->assertEqual('Settings(active tab)', $result[0]->getText(), 'The settings tab is active.'); + $this->assertEqual('Derive 1(active tab)', $result[1]->getText(), 'The derive1 tab is active.'); // Ensures that the local tasks contains the proper 'provider key' $definitions = $this->container->get('plugin.manager.menu.local_task')->getDefinitions(); @@ -190,7 +190,7 @@ public function testPluginLocalTask() { $result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]'); $this->assertEqual(1, count($result), 'There is one active tab.'); - $this->assertEqual('upcasting sub1(active tab)', $result[0]->find('a')->getText(), 'The "upcasting sub1" tab is active.'); + $this->assertEqual('upcasting sub1(active tab)', $result[0]->getText(), 'The "upcasting sub1" tab is active.'); $this->drupalGet(Url::fromRoute('menu_test.local_task_test_upcasting_sub2', ['entity_test' => '1'])); @@ -202,7 +202,7 @@ public function testPluginLocalTask() { $result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]'); $this->assertEqual(1, count($result), 'There is one active tab.'); - $this->assertEqual('upcasting sub2(active tab)', $result[0]->find('a')->getText(), 'The "upcasting sub2" tab is active.'); + $this->assertEqual('upcasting sub2(active tab)', $result[0]->getText(), 'The "upcasting sub2" tab is active.'); } /**