diff --git a/core/lib/Drupal/Core/Utility/LinkGenerator.php b/core/lib/Drupal/Core/Utility/LinkGenerator.php index 78d49f9..36e7030 100644 --- a/core/lib/Drupal/Core/Utility/LinkGenerator.php +++ b/core/lib/Drupal/Core/Utility/LinkGenerator.php @@ -127,7 +127,7 @@ public function setRequest(Request $request) { * * @see \Drupal\Core\Routing\UrlGenerator::generate() */ - public function render($text, $route_name, array $parameters = array(), array $options = array()) { + public function link($text, $route_name, array $parameters = array(), array $options = array()) { // Start building a structured representation of our link to be altered later. $variables = array( 'text' => is_array($text) ? drupal_render($text) : $text, diff --git a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php index 8871cd8..034fdad 100644 --- a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php +++ b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php @@ -79,7 +79,7 @@ public function setUpLanguageManager() { /** * Tests the render method. * - * @see \Drupal\Core\Utility\LinkGenerator::render() + * @see \Drupal\Core\Utility\LinkGenerator::render(link */ public function testRender() { $this->urlGenerator->expects($this->exactly(2)) @@ -101,17 +101,17 @@ public function testRender() { $request = new Request(); $this->linkGenerator->setRequest($request); - $result = $this->linkGenerator->render('Test', 'test_route_1'); + $result = $this->linkGenerator->link('Test', 'test_route_1'); $this->assertTag(array('tag' => 'a', 'attributes' => array('href' => '/test-route-1')), $result); - $result = $this->linkGenerator->render('Test', 'test_route_2', array('value' => 'example')); + $result = $this->linkGenerator->link('Test', 'test_route_2', array('value' => 'example')); $this->assertTag(array('tag' => 'a', 'attributes' => array('href' => '/test-route-2/example')), $result); } /** * Tests the active class on the render method. * - * @see \Drupal\Core\Utility\LinkGenerator::render() + * @see \Drupal\Core\Utility\LinkGenerator::render(link */ public function testRenderActive() { $this->urlGenerator->expects($this->exactly(2)) @@ -129,14 +129,14 @@ public function testRenderActive() { $request = new Request(array(), array(), array('system_path' => 'test-route-2')); $this->linkGenerator->setRequest($request); - $result = $this->linkGenerator->render('Test', 'test_route_1'); + $result = $this->linkGenerator->link('Test', 'test_route_1'); $this->assertNotTag(array('tag' => 'a', 'attributes' => array('class' => 'active')), $result); // Render a link with a path with the same path as the current path. $request = new Request(array(), array(), array('system_path' => 'test-route-1')); $this->linkGenerator->setRequest($request); - $result = $this->linkGenerator->render('Test', 'test_route_1'); + $result = $this->linkGenerator->link('Test', 'test_route_1'); $this->assertTag(array('tag' => 'a', 'attributes' => array('class' => 'active')), $result); }