This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local patch for #2992274 Installer tests fail if contrib driver hides…
… database credentials form fields (#319)
- Loading branch information
Showing
3 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php | ||
index 7ded3eec27..851b0343fb 100644 | ||
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php | ||
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php | ||
@@ -10,6 +10,7 @@ | ||
use Drupal\Core\Utility\PhpRequirements; | ||
use Drupal\Tests\BrowserTestBase; | ||
use Drupal\Tests\RequirementsPageTrait; | ||
+use Behat\Mink\Exception\ElementNotFoundException; | ||
use GuzzleHttp\HandlerStack; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
@@ -258,8 +259,23 @@ protected function setUpSettings() { | ||
$parameters = $this->parameters['forms']['install_settings_form']; | ||
$driver = $parameters['driver']; | ||
unset($parameters[$driver]['dependencies']); | ||
- $edit = $this->translatePostValues($parameters); | ||
- $this->submitForm($edit, $this->translations['Save and continue']); | ||
+ | ||
+ $form_values_to_submit = $this->translatePostValues($parameters); | ||
+ | ||
+ // Ensure that the fields to be edited actually exist on the form. | ||
+ $assert_session = $this->assertSession(); | ||
+ $form_values = []; | ||
+ foreach ($form_values_to_submit as $name => $value) { | ||
+ try { | ||
+ $field = $assert_session->fieldExists($name); | ||
+ $form_values[$name] = $value; | ||
+ } | ||
+ catch (ElementNotFoundException $e) { | ||
+ continue; | ||
+ } | ||
+ } | ||
+ | ||
+ $this->submitForm($form_values, $this->translations['Save and continue']); | ||
} | ||
|
||
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
#!/bin/sh -e | ||
|
||
#2992274 Installer tests fail if contrib driver hides database credentials form fields | ||
# curl https://www.drupal.org/files/issues/2022-06-01/2992274-25.patch | git apply -v | ||
|
||
#3110546 Allow contributed modules (mostly database drivers) to override tests in core | ||
curl https://git.drupalcode.org/project/drupal/-/merge_requests/291.diff | git apply -v | ||
|
||
#3256642 Introduce database driver extensions and autoload database drivers' dependencies | ||
curl https://git.drupalcode.org/project/drupal/-/merge_requests/3169.diff | git apply -v | ||
|
||
#2992274 Installer tests fail if contrib driver hides database credentials form fields | ||
# curl https://www.drupal.org/files/issues/2022-06-01/2992274-25.patch | git apply -v | ||
git apply -v ./drudbal_staging/tests/github/2992274-local.patch | ||
|
||
#3347497 Introduce a FetchModeTrait to allow emulating PDO fetch modes | ||
curl https://git.drupalcode.org/project/drupal/-/merge_requests/3676.diff | git apply -v |