diff --git a/core/modules/system/src/Tests/Menu/MenuRouterTest.php b/core/modules/system/src/Tests/Menu/MenuRouterTest.php
index 48c7500..53b2799 100644
--- a/core/modules/system/src/Tests/Menu/MenuRouterTest.php
+++ b/core/modules/system/src/Tests/Menu/MenuRouterTest.php
@@ -7,6 +7,7 @@
namespace Drupal\system\Tests\Menu;
+use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
/**
@@ -62,7 +63,8 @@ public function testMenuIntegration() {
*/
protected function doTestHookMenuIntegration() {
// Generate base path with random argument.
- $base_path = 'foo/' . $this->randomMachineName(8);
+ $machine_name = $this->randomMachineName(8);
+ $base_path = 'foo/' . $machine_name;
$this->drupalGet($base_path);
// Confirm correct controller activated.
$this->assertText('test1');
@@ -70,8 +72,8 @@ protected function doTestHookMenuIntegration() {
$this->assertLink('Local task A');
$this->assertLink('Local task B');
// Confirm correct local task href.
- $this->assertLinkByHref(_url($base_path));
- $this->assertLinkByHref(_url($base_path . '/b'));
+ $this->assertLinkByHref(Url::fromRoute('menu_test.router_test1', ['bar' => $machine_name])->toString());
+ $this->assertLinkByHref(Url::fromRoute('menu_test.router_test2', ['bar' => $machine_name])->toString());
}
/**
diff --git a/core/modules/system/src/Tests/Menu/MenuTranslateTest.php b/core/modules/system/src/Tests/Menu/MenuTranslateTest.php
index ea4b302..e316c95 100644
--- a/core/modules/system/src/Tests/Menu/MenuTranslateTest.php
+++ b/core/modules/system/src/Tests/Menu/MenuTranslateTest.php
@@ -7,6 +7,7 @@
namespace Drupal\system\Tests\Menu;
+use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
/**
@@ -40,7 +41,7 @@ public function testMenuTranslate() {
$this->assertResponse(403);
$elements = $this->xpath('//ul[@class=:class]/li/a[@href=:href]', array(
':class' => 'tabs primary',
- ':href' => _url('foo/asdf'),
+ ':href' => Url::fromRoute('menu_test.router_test1', ['bar' => 'asdf'])->toString(),
));
$this->assertTrue(empty($elements), 'No tab linking to foo/asdf found');
$this->assertNoLinkByHref('foo/asdf/b');
diff --git a/core/modules/system/src/Tests/Theme/FunctionsTest.php b/core/modules/system/src/Tests/Theme/FunctionsTest.php
index f9a4a83..1dd8fd8 100644
--- a/core/modules/system/src/Tests/Theme/FunctionsTest.php
+++ b/core/modules/system/src/Tests/Theme/FunctionsTest.php
@@ -217,7 +217,7 @@ function testLinks() {
$expected_links .= '
';
$expected_links .= '- ' . String::checkPlain('A ') . '
';
$expected_links .= '- ' . String::checkPlain('Plain "text"') . '
';
- $expected_links .= '- ' . String::checkPlain('Front page') . '
';
+ $expected_links .= '- ' . String::checkPlain('Front page') . '
';
$expected_links .= '- ' . String::checkPlain('Test route') . '
';
$query = array('key' => 'value');
$expected_links .= '- ' . String::checkPlain('Query test route') . '
';
@@ -256,7 +256,7 @@ function testLinks() {
$expected_links .= '';
$expected_links .= '- ' . String::checkPlain('A ') . '
';
$expected_links .= '- ' . String::checkPlain('Plain "text"') . '
';
- $expected_links .= '- ' . String::checkPlain('Front page') . '
';
+ $expected_links .= '- ' . String::checkPlain('Front page') . '
';
$expected_links .= '- ' . String::checkPlain('Test route') . '
';
$query = array('key' => 'value');
$expected_links .= '- ' . String::checkPlain('Query test route') . '
';
@@ -271,7 +271,7 @@ function testLinks() {
$expected_links .= '';
$expected_links .= '- ' . String::checkPlain('A ') . '
';
$expected_links .= '- ' . String::checkPlain('Plain "text"') . '
';
- $expected_links .= '- ' . String::checkPlain('Front page') . '
';
+ $expected_links .= '- ' . String::checkPlain('Front page') . '
';
$expected_links .= '- ' . String::checkPlain('Test route') . '
';
$query = array('key' => 'value');
$encoded_query = String::checkPlain(Json::encode($query));
diff --git a/core/modules/views/src/Tests/GlossaryTest.php b/core/modules/views/src/Tests/GlossaryTest.php
index 61fb6a3..448101c 100644
--- a/core/modules/views/src/Tests/GlossaryTest.php
+++ b/core/modules/views/src/Tests/GlossaryTest.php
@@ -8,6 +8,7 @@
namespace Drupal\views\Tests;
use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Url;
use Drupal\views\Views;
/**
@@ -66,7 +67,7 @@ public function testGlossaryView() {
$this->assertResponse(200);
foreach ($nodes_per_char as $char => $count) {
- $href = _url('glossary/' . $char);
+ $href = Url::fromRoute('views.glossary.page_1', ['arg_0' => $char]);
$label = Unicode::strtoupper($char);
// Get the summary link for a certain character. Filter by label and href
// to ensure that both of them are correct.
diff --git a/core/modules/views/src/Tests/Wizard/BasicTest.php b/core/modules/views/src/Tests/Wizard/BasicTest.php
index ce4e581..e05bacc 100644
--- a/core/modules/views/src/Tests/Wizard/BasicTest.php
+++ b/core/modules/views/src/Tests/Wizard/BasicTest.php
@@ -75,7 +75,7 @@ function testViewsWizardAndListing() {
$this->assertText($node2->label());
// Check if we have the feed.
- $elements = $this->cssSelect('link[href="' . Url::fromUri('base://' . $view2['page[feed_properties][path]'])->toString(), ['absolute' => TRUE]) . '"]');
+ $elements = $this->cssSelect('link[href="' . Url::fromUri('base://' . $view2['page[feed_properties][path]'], ['absolute' => TRUE])->toString() . '"]');
$this->assertEqual(count($elements), 1, 'Feed found.');
$this->drupalGet($view2['page[feed_properties][path]']);
$this->assertRaw('