public function DynamicMenuLinkMock::getRouteName in Zircon Profile 8.0
Same name and namespace in other branches
- 8 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\MenuCode
public function getRouteName() {
if ($this->currentUser
->isAuthenticated()) {
return 'user.logout';
}
else {
return 'user.login';
}
}