diff --git a/src/Tests/PathautoNodeWebTest.php b/src/Tests/PathautoNodeWebTest.php
index 825b679..8acefd3 100644
--- a/src/Tests/PathautoNodeWebTest.php
+++ b/src/Tests/PathautoNodeWebTest.php
@@ -87,7 +87,7 @@ class PathautoNodeWebTest extends WebTestBase {
       'path[0][pathauto]' => FALSE,
       'path[0][alias]' => $manual_alias,
     );
-    $this->drupalPostForm($node->urlInfo('edit-form'), $edit, t('Save and keep published'));
+    $this->drupalPostForm($node->toUrl('edit-form'), $edit, t('Save and keep published'));
     $this->assertRaw(t('@type %title has been updated.', array('@type' => 'page', '%title' => $title)));
 
     // Check that the automatic alias checkbox is now unchecked by default.
@@ -139,7 +139,7 @@ class PathautoNodeWebTest extends WebTestBase {
     $node = $this->drupalGetNodeByTitle($edit['title']);
 
     // Pathauto checkbox should still not exist.
-    $this->drupalGet($node->urlInfo('edit-form'));
+    $this->drupalGet($node->toUrl('edit-form'));
     $this->assertNoFieldById('edit-path-0-pathauto');
     $this->assertFieldByName('path[0][alias]', '');
     $this->assertNoEntityAlias($node);
diff --git a/src/Tests/PathautoTestHelperTrait.php b/src/Tests/PathautoTestHelperTrait.php
index 705920b..74090f4 100644
--- a/src/Tests/PathautoTestHelperTrait.php
+++ b/src/Tests/PathautoTestHelperTrait.php
@@ -88,7 +88,7 @@ trait PathautoTestHelperTrait {
     if (!$langcode) {
       $langcode = $entity->language()->getId();
     }
-    return $this->saveAlias('/' . $entity->urlInfo()->getInternalPath(), $alias, $langcode);
+    return $this->saveAlias('/' . $entity->toUrl()->getInternalPath(), $alias, $langcode);
   }
 
   public function assertEntityAlias(EntityInterface $entity, $expected_alias, $langcode = NULL) {
@@ -96,11 +96,11 @@ trait PathautoTestHelperTrait {
     if (!$langcode) {
       $langcode = $entity->language()->getId();
     }
-    $this->assertAlias('/' . $entity->urlInfo()->getInternalPath(), $expected_alias, $langcode);
+    $this->assertAlias('/' . $entity->toUrl()->getInternalPath(), $expected_alias, $langcode);
   }
 
   public function assertEntityAliasExists(EntityInterface $entity) {
-    return $this->assertAliasExists(array('source' => '/' . $entity->urlInfo()->getInternalPath()));
+    return $this->assertAliasExists(array('source' => '/' . $entity->toUrl()->getInternalPath()));
   }
 
   public function assertNoEntityAlias(EntityInterface $entity, $langcode = NULL) {
@@ -108,11 +108,11 @@ trait PathautoTestHelperTrait {
     if (!$langcode) {
       $langcode = $entity->language()->getId();
     }
-    $this->assertEntityAlias($entity, '/' . $entity->urlInfo()->getInternalPath(), $langcode);
+    $this->assertEntityAlias($entity, '/' . $entity->toUrl()->getInternalPath(), $langcode);
   }
 
   public function assertNoEntityAliasExists(EntityInterface $entity, $alias = NULL) {
-    $path = array('source' => '/' . $entity->urlInfo()->getInternalPath());
+    $path = array('source' => '/' . $entity->toUrl()->getInternalPath());
     if (!empty($alias)) {
       $path['alias'] = $alias;
     }
diff --git a/tests/src/Kernel/PathautoKernelTest.php b/tests/src/Kernel/PathautoKernelTest.php
index 42e29c2..093fbe6 100644
--- a/tests/src/Kernel/PathautoKernelTest.php
+++ b/tests/src/Kernel/PathautoKernelTest.php
@@ -269,7 +269,7 @@ class PathautoKernelTest extends KernelTestBase {
     $node->setTitle('Third title');
     $node->save();
     $this->assertEntityAlias($node, '/content/third-title');
-    $this->assertAliasExists(array('source' => '/' . $node->urlInfo()->getInternalPath(), 'alias' => '/content/second-title'));
+    $this->assertAliasExists(array('source' => '/' . $node->toUrl()->getInternalPath(), 'alias' => '/content/second-title'));
 
     $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_DELETE);
     $config->save();
@@ -278,7 +278,7 @@ class PathautoKernelTest extends KernelTestBase {
     $this->assertEntityAlias($node, '/content/fourth-title');
     $this->assertNoAliasExists(array('alias' => '/content/third-title'));
     // The older second alias is not deleted yet.
-    $older_path = $this->assertAliasExists(array('source' => '/' . $node->urlInfo()->getInternalPath(), 'alias' => '/content/second-title'));
+    $older_path = $this->assertAliasExists(array('source' => '/' . $node->toUrl()->getInternalPath(), 'alias' => '/content/second-title'));
     \Drupal::service('path.alias_storage')->delete($older_path);
 
     $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW);
