From 3e4df3ac181180430d26216f5656d20beb7bfbe0 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Wed, 22 Jun 2022 11:44:11 +0100 Subject: [PATCH] Issue #3291877 by alexpott, longwave: Fix \Drupal\FunctionalTests\Installer\InstallerTestBase tests to not test drupal.org --- .../Drupal/FunctionalTests/BrowserTestBaseTest.php | 3 +++ .../Installer/InstallerExistingConfigTestBase.php | 3 ++- .../FunctionalTests/Installer/InstallerTest.php | 3 +++ .../FunctionalTests/Installer/InstallerTestBase.php | 13 +++++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php index f8fb83631aab..84df3399c863 100644 --- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -555,6 +555,9 @@ public function testCronRun() { public function testInstall() { $htaccess_filename = $this->tempFilesDirectory . '/.htaccess'; $this->assertFileExists($htaccess_filename); + + // Ensure the update module is not installed. + $this->assertFalse(\Drupal::moduleHandler()->moduleExists('update'), 'The Update module is not installed.'); } /** diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php index 8a6a9308fcaa..1e04685e241d 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php @@ -105,7 +105,8 @@ protected function installParameters() { // existing configuration. unset($parameters['forms']['install_configure_form']['site_name']); unset($parameters['forms']['install_configure_form']['site_mail']); - unset($parameters['forms']['install_configure_form']['update_status_module']); + unset($parameters['forms']['install_configure_form']['enable_update_status_module']); + unset($parameters['forms']['install_configure_form']['enable_update_status_emails']); return $parameters; } diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php index 118a77124577..af85b7e7fd22 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php @@ -131,6 +131,9 @@ public function testInstalled() { $module = $database->getProvider(); $module_handler = \Drupal::service('module_handler'); + // Ensure the update module is not installed. + $this->assertFalse($module_handler->moduleExists('update'), 'The Update module is not installed.'); + // Assert that the module that is providing the database driver has been // installed. $this->assertTrue($module_handler->moduleExists($module)); diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php index 4b6c28d40f15..5bf4918d084e 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php @@ -73,6 +73,19 @@ abstract class InstallerTestBase extends BrowserTestBase { */ protected $isInstalled = FALSE; + /** + * {@inheritdoc} + */ + protected function installParameters() { + $params = parent::installParameters(); + // Set the checkbox values to FALSE so that + // \Drupal\Tests\BrowserTestBase::translatePostValues() does not remove + // them. + $params['forms']['install_configure_form']['enable_update_status_module'] = FALSE; + $params['forms']['install_configure_form']['enable_update_status_emails'] = FALSE; + return $params; + } + /** * {@inheritdoc} */ -- GitLab