diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php index 23d5c295f3..c09b7ca723 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php @@ -97,28 +97,6 @@ protected function tearDown() { parent::tearDown(); } - /** - * Transforms a nested array into a flat array suitable for BrowserTestBase::drupalPostForm(). - * - * @param array $values - * A multi-dimensional form values array to convert. - * - * @return array - * The flattened $edit array suitable for BrowserTestBase::drupalPostForm(). - */ - protected function translatePostValues(array $values) { - $edit = []; - // The easiest and most straightforward way to translate values suitable for - // BrowserTestBase::drupalPostForm() is to actually build the POST data string - // and convert the resulting key/value pairs back into a flat array. - $query = http_build_query($values); - foreach (explode('&', $query) as $item) { - list($key, $value) = explode('=', $item); - $edit[urldecode($key)] = urldecode($value); - } - return $edit; - } - /** * Tests the displayed upgrade paths. * diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php index 55569a28d9..052b8b887f 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php @@ -262,28 +262,6 @@ protected function setUpSite() { $this->isInstalled = TRUE; } - /** - * Transforms a nested array into a flat array suitable for drupalPostForm(). - * - * @param array $values - * A multi-dimensional form values array to convert. - * - * @return array - * The flattened $edit array suitable for BrowserTestBase::drupalPostForm(). - */ - protected function translatePostValues(array $values) { - $edit = []; - // The easiest and most straightforward way to translate values suitable for - // BrowserTestBase::drupalPostForm() is to actually build the POST data - // string and convert the resulting key/value pairs back into a flat array. - $query = http_build_query($values); - foreach (explode('&', $query) as $item) { - list($key, $value) = explode('=', $item); - $edit[urldecode($key)] = urldecode($value); - } - return $edit; - } - /** * {@inheritdoc} * diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php index c3c893ad2c..bc33a5c328 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -1316,6 +1316,28 @@ protected function getTestMethodCaller() { return $caller; } + /** + * Transforms a nested array into a flat array suitable for drupalPostForm(). + * + * @param array $values + * A multi-dimensional form values array to convert. + * + * @return array + * The flattened $edit array suitable for BrowserTestBase::drupalPostForm(). + */ + protected function translatePostValues(array $values) { + $edit = []; + // The easiest and most straightforward way to translate values suitable for + // BrowserTestBase::drupalPostForm() is to actually build the POST data + // string and convert the resulting key/value pairs back into a flat array. + $query = http_build_query($values); + foreach (explode('&', $query) as $item) { + list($key, $value) = explode('=', $item); + $edit[urldecode($key)] = urldecode($value); + } + return $edit; + } + /** * Checks for meta refresh tag and if found call drupalGet() recursively. *