diff --git a/core/includes/schema.inc b/core/includes/schema.inc
index f46739c..e779698 100644
--- a/core/includes/schema.inc
+++ b/core/includes/schema.inc
@@ -284,8 +284,11 @@ function drupal_get_schema_unprocessed($module, $table = NULL) {
   module_load_install($module);
   $schema = module_invoke($module, 'schema');
 
-  if (isset($table) && isset($schema[$table])) {
-    return $schema[$table];
+  if (isset($table)) {
+    if (isset($schema[$table])) {
+      return $schema[$table];
+    }
+    return array();
   }
   elseif (!empty($schema)) {
     return $schema;
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
index a21d496..48f512c 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
@@ -117,10 +117,18 @@ protected function setUp() {
    *   The name of the table to install.
    */
   protected function installSchema($module, $table) {
-    require_once DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$module.install";
-    $function = $module . '_schema';
-    $schema = $function();
-    Database::getConnection()->schema()->createTable($table, $schema[$table]);
+    $schema = drupal_get_schema_unprocessed($module, $table);
+    if (empty($schema)) {
+      throw new \RuntimeException(format_string("Unable to retrieve '@module' module schema for '@table' table.", array(
+        '@module' => $module,
+        '@table' => $table,
+      )));
+    }
+    Database::getConnection()->schema()->createTable($table, $schema);
+    // We need to refresh the schema cache, as any call to drupal_get_schema()
+    // would not know of/return the schema otherwise.
+    // @todo Very expensive. Refactor the Schema API to make this obsolete.
+    drupal_get_schema(NULL, TRUE);
   }
 
   /**
@@ -132,7 +140,8 @@ protected function installSchema($module, $table) {
    * has no effect, since we are operating with a fixed module list.
    *
    * @param array $modules
-   *   A list of modules to enable.
+   *   A list of modules to enable. Dependencies are not resolved; i.e.,
+   *   multiple modules have to be specified with dependent modules first.
    * @param bool $install
    *   (optional) Whether to install the list of modules via module_enable().
    *   Defaults to TRUE. If FALSE, the new modules are only added to the fixed
@@ -150,11 +159,12 @@ protected function enableModules(array $modules, $install = TRUE) {
 
     // Call module_enable() to enable (install) the new modules.
     if ($install) {
-      module_enable($modules);
+      module_enable($modules, FALSE);
     }
     // Otherwise, only ensure that the new modules are loaded.
     else {
       module_load_all(FALSE, TRUE);
     }
   }
+
 }
