You are here

public function DynamicMenuLinkMock::getTitle in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Menu/DynamicMenuLinkMock.php \Drupal\Tests\Core\Menu\DynamicMenuLinkMock::getTitle()

Returns the localized title to be shown for this link.

Return value

string The title of the menu link.

Overrides MenuLinkMock::getTitle

File

core/tests/Drupal/Tests/Core/Menu/DynamicMenuLinkMock.php, line 47
Contains \Drupal\Tests\Core\Menu\DynamicMenuLinkMock.

Class

DynamicMenuLinkMock
Defines a mock implementation of a dynamic menu link used in tests only.

Namespace

Drupal\Tests\Core\Menu

Code

public function getTitle() {
  if ($this->currentUser
    ->isAuthenticated()) {
    return 'Log out';
  }
  else {
    return 'Log in';
  }
}