Commit f3f3efae authored by alexpott's avatar alexpott

Issue #2558187 by sdstyles: Remove usage of...

Issue #2558187 by sdstyles: Remove usage of UrlGeneratorInterface::generateFromPath() in language module
parent db440689
...@@ -205,20 +205,20 @@ function testLanguageBlockWithDomain() { ...@@ -205,20 +205,20 @@ function testLanguageBlockWithDomain() {
/** @var \Drupal\Core\Routing\UrlGenerator $generator */ /** @var \Drupal\Core\Routing\UrlGenerator $generator */
$generator = $this->container->get('url_generator'); $generator = $this->container->get('url_generator');
// Verfify the English URL is correct // Verify the English URL is correct
list($english_link) = $this->xpath('//div[@id=:id]/ul/li/a[@hreflang=:hreflang]', array( list($english_link) = $this->xpath('//div[@id=:id]/ul/li/a[@hreflang=:hreflang]', array(
':id' => 'block-test-language-block', ':id' => 'block-test-language-block',
':hreflang' => 'en', ':hreflang' => 'en',
)); ));
$english_url = $generator->generateFromPath('user/2', array('language' => $languages['en'])); $english_url = $generator->generateFromRoute('entity.user.canonical', array('user' => 2), array('language' => $languages['en']));
$this->assertEqual($english_url, (string) $english_link['href']); $this->assertEqual($english_url, (string) $english_link['href']);
// Verfify the Italian URL is correct // Verify the Italian URL is correct
list($italian_link) = $this->xpath('//div[@id=:id]/ul/li/a[@hreflang=:hreflang]', array( list($italian_link) = $this->xpath('//div[@id=:id]/ul/li/a[@hreflang=:hreflang]', array(
':id' => 'block-test-language-block', ':id' => 'block-test-language-block',
':hreflang' => 'it', ':hreflang' => 'it',
)); ));
$italian_url = $generator->generateFromPath('user/2', array('language' => $languages['it'])); $italian_url = $generator->generateFromRoute('entity.user.canonical', array('user' => 2), array('language' => $languages['it']));
$this->assertEqual($italian_url, (string) $italian_link['href']); $this->assertEqual($italian_url, (string) $italian_link['href']);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment