You are here

protected function ConfigInstallerTestBase::setUpSite in Configuration installer 8

Overrides method.

We have several forms to navigate through.

Overrides InstallerTestBase::setUpSite

File

tests/src/Functional/ConfigInstallerTestBase.php, line 81

Class

ConfigInstallerTestBase
Provides functionality for testing the config_installer profile.

Namespace

Drupal\Tests\config_installer\Functional

Code

protected function setUpSite() {

  // Recreate the container so that we can simulate the submission of the
  // SyncConfigureForm after the full bootstrap has occurred. Without out this
  // drupal_realpath() does not work so uploading files through
  // WebTestBase::postForm() is impossible.
  $request = Request::createFromGlobals();
  $class_loader = (require $this->container
    ->get('app.root') . '/autoload.php');
  Settings::initialize($this->container
    ->get('app.root'), DrupalKernel::findSitePath($request), $class_loader);
  foreach ($GLOBALS['config_directories'] as $type => $path) {
    $this->configDirectories[$type] = $path;
  }
  $this->kernel = DrupalKernel::createFromRequest($request, $class_loader, 'prod', FALSE);
  $this->kernel
    ->prepareLegacyRequest($request);
  $this->container = $this->kernel
    ->getContainer();
  $this
    ->setUpSyncForm();
  $this
    ->setUpInstallConfigureForm();

  // If we've got to this point the site is installed using the regular
  // installation workflow.
  $this->isInstalled = TRUE;
}