diff --git a/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php b/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php
index 482eea9..9b85f62 100644
--- a/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php
+++ b/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php
@@ -8,9 +8,12 @@
 namespace Drupal\system\Tests\Menu;
 
 use Drupal\Component\Plugin\Exception\PluginException;
+use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Menu\MenuTreeParameters;
 use Drupal\Core\Menu\MenuTreeStorage;
+use Drupal\menu_link_content\Entity\MenuLinkContent;
 use Drupal\simpletest\KernelTestBase;
+use Drupal\system\Entity\Menu;
 
 /**
  * Tests the menu tree storage.
@@ -36,11 +39,18 @@ class MenuTreeStorageTest extends KernelTestBase {
   protected $connection;
 
   /**
+   * The menu link plugin manager.
+   *
+   * @var \Drupal\Core\Menu\MenuLinkManagerInterface $menuLinkManager
+   */
+  protected $menuLinkManager;
+
+  /**
    * Modules to enable.
    *
    * @var array
    */
-  public static $modules = array('system');
+  public static $modules = array('system', 'link', 'node', 'menu_link_content', 'user');
 
   /**
    * {@inheritdoc}
@@ -50,6 +60,20 @@ protected function setUp() {
 
     $this->treeStorage = new MenuTreeStorage($this->container->get('database'), $this->container->get('cache.menu'), $this->container->get('cache_tags.invalidator'), 'menu_tree');
     $this->connection = $this->container->get('database');
+
+    $this->installSchema('system', ['router']);
+    $this->installEntitySchema('node');
+    $this->installEntitySchema('user');
+    $this->installEntitySchema('menu_link_content');
+
+    $this->menuLinkManager = \Drupal::service('plugin.manager.menu.link');
+
+    Menu::create([
+      'id' => 'menu_test',
+      'label' => 'Test menu',
+      'description' => 'Description text',
+    ])->save();
+
   }
 
   /**
@@ -462,4 +486,38 @@ protected function assertMenuLink($id, array $expected_properties, array $parent
     $this->assertEqual(array_intersect($children, $found_children), $children, 'Child IDs match');
   }
 
+  /**
+   * Tests creating links with the path created using views and test
+   * relationship on rebuild.
+   */
+  public function testParentChildRelationshipOnMenuRebuild() {
+    $this->menuLinkManager->deleteLinksInMenu('menu_test');
+    $base_options = [
+      'title' => 'Menu link test',
+      'provider' => 'menu_test',
+      'menu_name' => 'menu_test',
+    ];
+
+    $parent = $base_options + [
+      'link' => [['uri' => 'entity:admin/structure/types']],
+    ];
+
+    $link = MenuLinkContent::create($parent);
+    $link->save();
+    $links['parent'] = $link->getPluginId();
+
+    $child = $base_options + [
+      'link' => [['uri' => 'internal:/admin/content']],
+      'parent' => $links['parent'],
+    ];
+    $link = MenuLinkContent::create($child);
+    $link->save();
+    $links['child'] = $link->getPluginId();
+
+    $this->menuLinkManager->rebuild();
+
+    $child_menu = $this->menuLinkManager->createInstance($links['child']);
+    $this->assertEqual($child_menu->getParent(), $links['parent'], SafeMarkup::format('Menu link %id has parent %parent, expected %expected_parent.', ['%id' => $links['child'], '%parent' => $child_menu->getParent(), '%expected_parent' => $links['parent']]));
+  }
+
 }
