@@ -46,15 +46,15 @@ public function testSecondaryMenu() {
// For a logged-in user, expect the secondary menu to have links for "My
// account" and "Log out".
$this->assertSession()->elementsCount('xpath','//ul[@class="menu"]/li/a[contains(@href, "user") and text()="My account"]',1);
$this->assertSession()->elementsCount('xpath','//ul[@class="menu"]/li/a[contains(@href, "user/logout") and text()="Log out"]',1);
$this->assertSession()->elementsCount('xpath','//nav[@id="block-user-account-links-test-system-menu-block-account"]/ul/li/a[contains(@href, "user") and text()="My account"]',1);
$this->assertSession()->elementsCount('xpath','//nav[@id="block-user-account-links-test-system-menu-block-account"]/ul/li/a[contains(@href, "user/logout") and text()="Log out"]',1);
// Log out and get the homepage.
$this->drupalLogout();
$this->drupalGet('<front>');
// For a logged-out user, expect the secondary menu to have a "Log in" link.
$this->assertSession()->elementsCount('xpath','//ul[@class="menu"]/li/a[contains(@href, "user/login") and text()="Log in"]',1);
$this->assertSession()->elementsCount('xpath','//nav[@id="block-user-account-links-test-system-menu-block-account"]/ul/li/a[contains(@href, "user/login") and text()="Log in"]',1);
}
/**
@@ -69,7 +69,7 @@ public function testDisabledAccountLink() {
// Verify that the 'My account' link exists before we check for its
// disappearance.
$this->assertSession()->elementsCount('xpath','//ul[@class="menu"]/li/a[contains(@href, "user") and text()="My account"]',1);
$this->assertSession()->elementsCount('xpath','//nav[@id="block-user-account-links-test-system-menu-block-account"]/ul/li/a[contains(@href, "user") and text()="My account"]',1);
// Verify that the 'My account' link is enabled. Do not assume the value of
// auto-increment is 1. Use XPath to obtain input element id and name using
@@ -87,7 +87,7 @@ public function testDisabledAccountLink() {
$this->drupalGet('<front>');
// Verify that the 'My account' link does not appear when disabled.
$this->assertSession()->elementNotExists('xpath','//ul[@class="menu"]/li/a[contains(@href, "user") and text()="My account"]');
$this->assertSession()->elementNotExists('xpath','//nav[@id="block-user-account-links-test-system-menu-block-account"]/ul/li/a[contains(@href, "user") and text()="My account"]');