Commit 3aaeda4b authored by catch's avatar catch
Browse files

Issue #3522970 by longwave, smustgrave: Remove unused BrowserTestBase::$originalContainer

(cherry picked from commit 9a2e10ea)
parent afa839f1
Loading
Loading
Loading
Loading
Loading
+1 −24
Original line number Diff line number Diff line
@@ -599,7 +599,7 @@ protected function installParameters() {
    ];

    // If we only have one db driver available, we cannot set the driver.
    if (count($this->getDatabaseTypes()) == 1) {
    if (count(Database::getDriverList()->getInstallableList()) == 1) {
      unset($parameters['forms']['install_settings_form']['driver']);
    }
    return $parameters;
@@ -730,27 +730,4 @@ protected function prepareEnvironment() {
    $callbacks = [];
  }

  /**
   * Returns all supported database driver installer objects.
   *
   * This wraps DatabaseDriverList::getInstallableList() for use without a
   * current container.
   *
   * @return \Drupal\Core\Database\Install\Tasks[]
   *   An array of available database driver installer objects.
   */
  protected function getDatabaseTypes() {
    if (isset($this->originalContainer) && $this->originalContainer) {
      \Drupal::setContainer($this->originalContainer);
    }
    $database_types = [];
    foreach (Database::getDriverList()->getInstallableList() as $name => $driver) {
      $database_types[$name] = $driver->getInstallTasks();
    }
    if (isset($this->originalContainer) && $this->originalContainer) {
      \Drupal::unsetContainer();
    }
    return $database_types;
  }

}
+0 −10
Original line number Diff line number Diff line
@@ -172,16 +172,6 @@ abstract class BrowserTestBase extends TestCase {
   */
  protected $originalShutdownCallbacks = [];

  /**
   * The original container.
   *
   * Move this to \Drupal\Core\Test\FunctionalTestSetupTrait once TestBase no
   * longer provides the same value.
   *
   * @var \Symfony\Component\DependencyInjection\ContainerInterface
   */
  protected $originalContainer;

  /**
   * {@inheritdoc}
   */