diff --git a/core/includes/schema.inc b/core/includes/schema.inc index 4cf91ea..68afaca 100644 --- a/core/includes/schema.inc +++ b/core/includes/schema.inc @@ -340,18 +340,18 @@ function _drupal_schema_initialize(&$schema, $module, $remove_descriptions = TRU * An array of fields. */ function drupal_schema_fields_sql($table, $prefix = NULL) { - $schema = drupal_get_schema($table); - $fields = array_keys($schema['fields']); - if ($prefix) { - $columns = array(); - foreach ($fields as $field) { - $columns[] = "$prefix.$field"; + if ($schema = drupal_get_schema($table)) { + $fields = array_keys($schema['fields']); + if ($prefix) { + $columns = array(); + foreach ($fields as $field) { + $columns[] = "$prefix.$field"; + } + return $columns; } - return $columns; - } - else { return $fields; } + return array(); } /** diff --git a/core/modules/edit/lib/Drupal/edit/Tests/EditTestBase.php b/core/modules/edit/lib/Drupal/edit/Tests/EditTestBase.php index 573ce93..813a3a3 100644 --- a/core/modules/edit/lib/Drupal/edit/Tests/EditTestBase.php +++ b/core/modules/edit/lib/Drupal/edit/Tests/EditTestBase.php @@ -20,7 +20,7 @@ class EditTestBase extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('system', 'entity', 'field_test', 'field', 'number', 'text', 'edit', 'edit_test'); + public static $modules = array('system', 'entity', 'number', 'text', 'edit', 'edit_test'); /** * Sets the default field storage backend for fields created during tests. diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index 7b0bef7..4390600 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -108,7 +108,7 @@ function testEnableForumField() { $edit['modules[Core][forum][enable]'] = FALSE; $this->drupalPost('admin/modules', $edit, t('Save configuration')); $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); - system_list_reset(); + $this->rebuildContainer(); $this->assertFalse(module_exists('forum'), 'Forum module is not enabled.'); // Attempt to re-enable the Forum module and ensure it does not try to @@ -117,7 +117,7 @@ function testEnableForumField() { $edit['modules[Core][forum][enable]'] = 'forum'; $this->drupalPost('admin/modules', $edit, t('Save configuration')); $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); - system_list_reset(); + $this->rebuildContainer(); $this->assertTrue(module_exists('forum'), 'Forum module is enabled.'); } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php index d68c4ca..c806f43 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php @@ -50,7 +50,6 @@ */ public static $modules = array(); - private $extension_handler; private $moduleFiles; private $themeFiles; private $themeData; @@ -111,7 +110,6 @@ protected function setUp() { unset($install[$system]); array_unshift($install, 'system'); } - $this->extension_handler = $this->container->get('extension_handler'); if ($install) { $this->enableModules($install); } @@ -215,20 +213,17 @@ protected function installSchema($module, $table) { */ protected function enableModules(array $modules, $install = TRUE) { // Explicitly set the list of modules in the extension handler. - $enabled = $this->extension_handler->getModuleList(); + $enabled = $this->container->get('extension_handler')->getModuleList(); foreach ($modules as $module) { $enabled[$module] = drupal_get_filename('module', $module); // Call module_enable() to enable (install) the new module. if ($install) { module_enable(array($module), FALSE); } - $this->extension_handler->setModuleList($enabled); - } - // Otherwise, only ensure that the new modules are loaded. - if (!$install) { - module_load_all(FALSE, TRUE); - $this->extension_handler->moduleImplementsReset(); + $this->container->get('extension_handler')->setModuleList($enabled); } + $this->container->get('extension_handler')->moduleImplementsReset(); + $this->container->get('extension_handler')->loadAll(FALSE, TRUE); } }