You are here

public function DynamicMenuLinkMock::getRouteName in Zircon Profile 8

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

Returns the route name, if available.

Return value

string The name of the route this menu link links to.

Overrides MenuLinkBase::getRouteName

File

core/tests/Drupal/Tests/Core/Menu/DynamicMenuLinkMock.php, line 59
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 getRouteName() {
  if ($this->currentUser
    ->isAuthenticated()) {
    return 'user.logout';
  }
  else {
    return 'user.login';
  }
}