installDefaultThemeFromClassProperty example

$this->kernel->boot();
      $this->kernel->preHandle($request);
      $this->container = $this->kernel->getContainer();

      // Manually configure the test mail collector implementation to prevent       // tests from sending out emails and collect them in state instead.       $this->container->get('config.factory')
        ->getEditable('system.mail')
        ->set('interface.default', 'test_mail_collector')
        ->save();

      $this->installDefaultThemeFromClassProperty($this->container);
    }
  }

  /** * {@inheritdoc} */
  protected function initFrontPage() {
    // We don't want to visit the front page with the installer when     // initializing Mink, so we do nothing here.   }

  
/** * Installs Drupal into the test site. */
  public function installDrupal() {
    $this->initUserSession();
    $this->prepareSettings();
    $this->doInstall();
    $this->initSettings();
    $this->container = $container = $this->initKernel(\Drupal::request());
    $this->initConfig($container);
    $this->installDefaultThemeFromClassProperty($container);
    $this->installModulesFromClassProperty($container);

    // Clear the static cache so that subsequent cache invalidations will work     // as expected.     $this->container->get('cache_tags.invalidator')->resetChecksums();

    // Generate a route to prime the URL generator with the correct base URL.     // @todo Remove in https://www.drupal.org/project/drupal/issues/3207896.     Url::fromRoute('<front>')->setAbsolute()->toString();

    // Explicitly call register() again on the container registered in \Drupal.
Home | Imprint | This part of the site doesn't use cookies.