diff --git a/core/modules/config/src/Tests/ConfigImportAllTest.php b/core/modules/config/src/Tests/ConfigImportAllTest.php index baeacb9..526e423 100644 --- a/core/modules/config/src/Tests/ConfigImportAllTest.php +++ b/core/modules/config/src/Tests/ConfigImportAllTest.php @@ -106,56 +106,199 @@ public function testInstallUninstall() { } return TRUE; }); + //print_r(array_keys($modules_to_uninstall)); + //return; + + // pass. + $modules_to_uninstall = [ + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // fail. + $modules_to_uninstall = [ + 'action' => TRUE, + 'aggregator' => TRUE, + 'automated_cron' => TRUE, + 'ban' => TRUE, + 'basic_auth' => TRUE, + 'big_pipe' => TRUE, + 'block' => TRUE, + 'block_content' => TRUE, + 'block_place' => TRUE, + 'book' => TRUE, + 'breakpoint' => TRUE, + 'ckeditor' => TRUE, + 'color' => TRUE, + 'comment' => TRUE, + 'config' => TRUE, + 'config_translation' => TRUE, + 'contact' => TRUE, + 'content_moderation' => TRUE, + 'content_translation' => TRUE, + 'contextual' => TRUE, + 'datetime' => TRUE, + 'datetime_range' => TRUE, + 'dblog' => TRUE, + 'dynamic_page_cache' => TRUE, + 'editor' => TRUE, + 'experimental_module_test' => TRUE, + 'field' => TRUE, + 'field_ui' => TRUE, + 'file' => TRUE, + 'filter' => TRUE, + 'forum' => TRUE, + 'hal' => TRUE, + 'help' => TRUE, + 'history' => TRUE, + 'image' => TRUE, + 'inline_form_errors' => TRUE, + 'language' => TRUE, + 'link' => TRUE, + 'locale' => TRUE, + 'menu_link_content' => TRUE, + 'menu_ui' => TRUE, + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // fail. + $modules_to_uninstall = [ + 'contextual' => TRUE, + 'datetime' => TRUE, + 'datetime_range' => TRUE, + 'dblog' => TRUE, + 'dynamic_page_cache' => TRUE, + 'editor' => TRUE, + 'experimental_module_test' => TRUE, + 'field' => TRUE, + 'field_ui' => TRUE, + 'file' => TRUE, + 'filter' => TRUE, + 'forum' => TRUE, + 'hal' => TRUE, + 'help' => TRUE, + 'history' => TRUE, + 'image' => TRUE, + 'inline_form_errors' => TRUE, + 'language' => TRUE, + 'link' => TRUE, + 'locale' => TRUE, + 'menu_link_content' => TRUE, + 'menu_ui' => TRUE, + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // fail. + $modules_to_uninstall = [ + 'hal' => TRUE, + 'help' => TRUE, + 'history' => TRUE, + 'image' => TRUE, + 'inline_form_errors' => TRUE, + 'language' => TRUE, + 'link' => TRUE, + 'locale' => TRUE, + 'menu_link_content' => TRUE, + 'menu_ui' => TRUE, + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // pass. + $modules_to_uninstall = [ + 'locale' => TRUE, + 'menu_link_content' => TRUE, + 'menu_ui' => TRUE, + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // fail. + $modules_to_uninstall = [ + 'inline_form_errors' => TRUE, + 'language' => TRUE, + 'link' => TRUE, + 'locale' => TRUE, + 'menu_link_content' => TRUE, + 'menu_ui' => TRUE, + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // fail. + $modules_to_uninstall = [ + 'language' => TRUE, + 'link' => TRUE, + 'locale' => TRUE, + 'menu_link_content' => TRUE, + 'menu_ui' => TRUE, + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // pass. + $modules_to_uninstall = [ + 'link' => TRUE, + 'locale' => TRUE, + 'menu_link_content' => TRUE, + 'menu_ui' => TRUE, + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // fail. + $modules_to_uninstall = [ + 'language' => TRUE, + 'locale' => TRUE, + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // fail. + $modules_to_uninstall = [ + 'language' => TRUE, + 'migrate' => TRUE, + 'migrate_drupal' => TRUE, + 'migrate_drupal_ui' => TRUE, + ]; + + // fail. + $modules_to_uninstall = [ + 'language' => TRUE, + 'migrate' => TRUE, + ]; + + // pass. + $modules_to_uninstall = [ + 'migrate' => TRUE, + ]; + + $modules_to_uninstall = [ + 'language' => TRUE, + 'migrate' => TRUE, + ]; + // Can not uninstall config and use admin/config/development/configuration! unset($modules_to_uninstall['config']); - $this->assertTrue(isset($modules_to_uninstall['comment']), 'The comment module will be disabled'); - $this->assertTrue(isset($modules_to_uninstall['file']), 'The File module will be disabled'); - $this->assertTrue(isset($modules_to_uninstall['editor']), 'The Editor module will be disabled'); - // Uninstall all modules that can be uninstalled. \Drupal::service('module_installer')->uninstall(array_keys($modules_to_uninstall)); - $this->assertModules(array_keys($modules_to_uninstall), FALSE); - foreach ($modules_to_uninstall as $module => $info) { - $this->assertNoModuleConfig($module); - $this->assertModuleTablesDoNotExist($module); - } - // Import the configuration thereby re-installing all the modules. $this->drupalPostForm('admin/config/development/configuration', array(), t('Import all')); - // Modules have been installed that have services. - $this->rebuildContainer(); - - // Check that there are no errors. - $this->assertIdentical($this->configImporter()->getErrors(), array()); - // Check that all modules that were uninstalled are now reinstalled. - $this->assertModules(array_keys($modules_to_uninstall), TRUE); - foreach ($modules_to_uninstall as $module => $info) { - $this->assertModuleConfig($module); - $this->assertModuleTablesExist($module); - } - - // Ensure that we have no configuration changes to import. - $storage_comparer = new StorageComparer( - $this->container->get('config.storage.sync'), - $this->container->get('config.storage'), - $this->container->get('config.manager') - ); - $this->assertIdentical($storage_comparer->createChangelist()->getChangelist(), $storage_comparer->getEmptyChangelist()); - - // Now we have all configuration imported, test all of them for schema - // conformance. Ensures all imported default configuration is valid when - // all modules are enabled. - $names = $this->container->get('config.storage')->listAll(); - /** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */ - $typed_config = $this->container->get('config.typed'); - foreach ($names as $name) { - $config = $this->config($name); - $this->assertConfigSchema($typed_config, $name, $config->get()); - } } } diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 3622642..21d91f9 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -1177,6 +1177,9 @@ protected function curlExec($curl_options, $redirect = FALSE) { ); $message = SafeMarkup::format('@method @url returned @status (@length).', $message_vars); $this->assertTrue($this->getRawContent() !== FALSE, $message, 'Browser'); + if ($status == 500) { + throw new \Exception(500); + } return $this->getRawContent(); }