diff --git a/core/lib/Drupal/Component/Discovery/YamlDiscovery.php b/core/lib/Drupal/Component/Discovery/YamlDiscovery.php
index bf4ee15..7c953e2 100644
--- a/core/lib/Drupal/Component/Discovery/YamlDiscovery.php
+++ b/core/lib/Drupal/Component/Discovery/YamlDiscovery.php
@@ -8,6 +8,7 @@
 namespace Drupal\Component\Discovery;
 
 use Drupal\Component\Serialization\Yaml;
+use Drupal\Component\Utility\NestedArray;
 
 /**
  * Provides discovery for YAML files within a given set of directories.
@@ -48,7 +49,23 @@ public function __construct($name, array $directories) {
   public function findAll() {
     $all = array();
     foreach ($this->findFiles() as $provider => $file) {
-      $all[$provider] = Yaml::decode(file_get_contents($file));
+      $contents = Yaml::decode(file_get_contents($file));
+      $all[$provider] = $contents;
+
+      // Load any additional imports.
+      if (isset($contents['imports']) && is_array($contents['imports'])) {
+        $base_path = dirname($file);
+
+        foreach ($contents['imports'] as $relative_path) {
+          $absolute_path = $base_path . '/' . $relative_path;
+
+          if (file_exists($absolute_path)) {
+            $all[$provider] = NestedArray::mergeDeep(Yaml::decode(file_get_contents($absolute_path)), $all[$provider]);
+          }
+        }
+
+        unset($all[$provider]['imports']);
+      }
     }
 
     return $all;
diff --git a/core/modules/system/src/Tests/Routing/RouterTest.php b/core/modules/system/src/Tests/Routing/RouterTest.php
index 05f86f7..f53b733 100644
--- a/core/modules/system/src/Tests/Routing/RouterTest.php
+++ b/core/modules/system/src/Tests/Routing/RouterTest.php
@@ -194,4 +194,14 @@ public function testRouterUninstall() {
     $route_count = \Drupal::database()->query('SELECT COUNT(*) FROM {router} WHERE name = :route_name', array(':route_name' => 'router_test.1'))->fetchField();
     $this->assertEqual(0, $route_count, 'All router_test routes have been removed on uninstall.');
   }
+
+  /**
+   * Confirms route importing.
+   */
+  public function testRouteImports() {
+    $this->drupalGet('router_test/test-imports');
+    $this->assertRaw('test', 'The correct string was returned because the route was successful.');
+    $this->assertResponse(200);
+  }
+
 }
diff --git a/core/modules/system/tests/modules/router_test_directory/router_test.routing.yml b/core/modules/system/tests/modules/router_test_directory/router_test.routing.yml
index 7405d88..afedabf 100644
--- a/core/modules/system/tests/modules/router_test_directory/router_test.routing.yml
+++ b/core/modules/system/tests/modules/router_test_directory/router_test.routing.yml
@@ -127,3 +127,6 @@ router_test.hierarchy_parent_child2:
     _controller: '\Drupal\router_test\TestControllers::test'
   requirements:
     _access: 'TRUE'
+
+imports:
+  - routes/router_test.foo.routing.yml
diff --git a/core/modules/system/tests/modules/router_test_directory/routes/router_test.foo.routing.yml b/core/modules/system/tests/modules/router_test_directory/routes/router_test.foo.routing.yml
new file mode 100644
index 0000000..a3aa366
--- /dev/null
+++ b/core/modules/system/tests/modules/router_test_directory/routes/router_test.foo.routing.yml
@@ -0,0 +1,6 @@
+router_test.imported:
+  path: '/router_test/test-imports'
+  defaults:
+    _controller: '\Drupal\router_test\TestControllers::test'
+  requirements:
+    _access: 'TRUE'
diff --git a/core/tests/Drupal/Tests/Component/Discovery/Fixtures/test_1/test_1.test.yml b/core/tests/Drupal/Tests/Component/Discovery/Fixtures/test_1/test_1.test.yml
deleted file mode 100644
index b327536..0000000
--- a/core/tests/Drupal/Tests/Component/Discovery/Fixtures/test_1/test_1.test.yml
+++ /dev/null
@@ -1 +0,0 @@
-name: test
diff --git a/core/tests/Drupal/Tests/Component/Discovery/Fixtures/test_2/test_2.test.yml b/core/tests/Drupal/Tests/Component/Discovery/Fixtures/test_2/test_2.test.yml
deleted file mode 100644
index b327536..0000000
--- a/core/tests/Drupal/Tests/Component/Discovery/Fixtures/test_2/test_2.test.yml
+++ /dev/null
@@ -1 +0,0 @@
-name: test
diff --git a/core/tests/Drupal/Tests/Component/Discovery/Fixtures/test_2/test_3.test.yml b/core/tests/Drupal/Tests/Component/Discovery/Fixtures/test_2/test_3.test.yml
deleted file mode 100644
index b327536..0000000
--- a/core/tests/Drupal/Tests/Component/Discovery/Fixtures/test_2/test_3.test.yml
+++ /dev/null
@@ -1 +0,0 @@
-name: test
diff --git a/core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php b/core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php
index a546992..c83516f 100644
--- a/core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php
@@ -9,31 +9,60 @@
 
 use Drupal\Tests\UnitTestCase;
 use Drupal\Component\Discovery\YamlDiscovery;
+use org\bovigo\vfs\vfsStream;
+use org\bovigo\vfs\vfsStreamDirectory;
+use org\bovigo\vfs\vfsStreamWrapper;
 
 /**
  * YamlDiscovery component unit tests.
  *
  * @group Discovery
+ * @coversDefaultClass \Drupal\Component\Discovery\YamlDiscovery
  */
 class YamlDiscoveryTest extends UnitTestCase {
 
   /**
+   * The test module base URL.
+   *
+   * @var string
+   */
+  protected $url;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    vfsStreamWrapper::register();
+    $root = new vfsStreamDirectory('test_modules');
+    vfsStreamWrapper::setRoot($root);
+    $this->url = vfsStream::url('test_modules');
+  }
+
+  /**
    * Tests the YAML file discovery.
+   *
+   * @covers ::findAll
    */
   public function testDiscovery() {
-    $base_path = __DIR__ . '/Fixtures';
     // Set up the directories to search.
     $directories = array(
-      'test_1' => $base_path . '/test_1',
-      'test_2' => $base_path . '/test_2',
+      'test_1' => $this->url . '/test_1',
+      'test_2' => $this->url . '/test_2',
       // Use the same directory with a different provider name.
-      'test_3' => $base_path . '/test_2',
+      'test_3' => $this->url . '/test_2',
     );
 
+    foreach ($directories as $provider => $directory) {
+      if (!file_exists($directory)) {
+        mkdir($directory);
+      }
+      file_put_contents($directory . '/' . $provider . '.test.yml', 'name: test');
+    }
+
     $discovery = new YamlDiscovery('test', $directories);
     $data = $discovery->findAll();
 
-    $this->assertEquals(count($data), count($directories));
+    $this->assertCount(3, $data);
     $this->assertArrayHasKey('test_1', $data);
     $this->assertArrayHasKey('test_2', $data);
     $this->assertArrayHasKey('test_3', $data);
@@ -44,4 +73,62 @@ public function testDiscovery() {
     }
   }
 
+  /**
+   * Tests the file import functionality.
+   *
+   * @covers ::findAll
+   */
+  public function testImport() {
+    // Set up the directories to search.
+    $directories = array(
+      'test_import' => $this->url . '/test_import',
+    );
+
+    $directory = $directories['test_import'];
+    mkdir($directory);
+
+    file_put_contents($directory . '/test_import.test.yml', "
+name: test
+unkeyed_data:
+  - value_1
+keyed_data:
+  value_1: value_1
+imports:
+  - test_import.yml
+    ");
+
+    file_put_contents($directory . '/test_import.yml', "
+# Name should not get overwritten from import.
+name: test_import
+additional: imported
+unkeyed_data:
+  - value_2
+keyed_data:
+  value_1: value_2
+  value_2: value_2
+    ");
+
+    $discovery = new YamlDiscovery('test', $directories);
+    $data = $discovery->findAll();
+
+    $this->assertCount(1, $data);
+    $this->assertArrayHasKey('test_import', $data);
+
+    $item = $data['test_import'];
+
+    $this->assertArrayHasKey('name', $item);
+    // 'test_import' name should not be inherited.
+    $this->assertEquals($item['name'], 'test');
+
+    // Check the new imported key exists.
+    $this->assertArrayHasKey('additional', $item);
+    $this->assertEquals($item['additional'], 'imported');
+    // Assert the count and items in the unkeyed data.
+    $this->assertCount(2, $item['unkeyed_data']);
+    $this->assertSame(array('value_2', 'value_1'), $item['unkeyed_data']);
+    // Assert that value_1 has not been overwritten and value is present in
+    // keyed data.
+    $this->assertSame('value_1', $item['keyed_data']['value_1']);
+    $this->assertSame('value_2', $item['keyed_data']['value_2']);
+  }
 }
