diff --git a/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php index 81beed4..153e87c 100644 --- a/core/modules/node/src/Tests/NodeTranslationUITest.php +++ b/core/modules/node/src/Tests/NodeTranslationUITest.php @@ -10,7 +10,6 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\content_translation\Tests\ContentTranslationUITest; use Drupal\Core\Language\LanguageInterface; -use Drupal\Core\Url; /** * Tests the Node Translation UI. @@ -292,7 +291,7 @@ function testTranslationRendering() { $this->doTestTranslations('node/' . $node->id(), $values); // Test that the node page has the correct alternate hreflang links. - $this->doTestAlternateHreflangLinks($node->urlInfo()); + $this->doTestAlternateHreflangLinks('node/' . $node->id()); } /** @@ -314,16 +313,16 @@ protected function doTestTranslations($path, array $values) { /** * Tests that the given path provides the correct alternate hreflang links. * - * @param \Drupal\Core\Url $url_info - * The url info to be tested. + * @param string $path + * The path to be tested. */ - protected function doTestAlternateHreflangLinks(Url $url_info) { + protected function doTestAlternateHreflangLinks($path) { $languages = $this->container->get('language_manager')->getLanguages(); foreach ($this->langcodes as $langcode) { - $urls[$langcode] = $url_info->setAbsolute()->setOption('language', $languages[$langcode])->toString(); + $urls[$langcode] = _url($path, array('absolute' => TRUE, 'language' => $languages[$langcode])); } foreach ($this->langcodes as $langcode) { - $this->drupalGet($url_info->toString(), array('language' => $languages[$langcode])); + $this->drupalGet($path, array('language' => $languages[$langcode])); foreach ($urls as $alternate_langcode => $url) { // Retrieve desired link elements from the HTML head. $links = $this->xpath('head/link[@rel = "alternate" and @href = :href and @hreflang = :hreflang]', diff --git a/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php b/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php index 67ae525..d80ece0 100644 --- a/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php +++ b/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php @@ -28,7 +28,12 @@ public function routes() { $routes = array(); foreach ($types as $entity_type_id) { $routes["entity.$entity_type_id.canonical"] = new Route( - $entity_type_id . '/{' . $entity_type_id . '}' + $entity_type_id . '/manage/{' . $entity_type_id . '}', + array('_controller' => '\Drupal\entity_test\Controller\EntityTestController::testEdit', 'entity_type_id' => $entity_type_id), + array('_permission' => 'administer entity_test content'), + array('parameters' => array( + $entity_type_id => array('type' => 'entity:' . $entity_type_id), + )) ); $routes["entity.$entity_type_id.add_form"] = new Route(