ComponentNegotiator example

parent::setUp();
    if (empty(static::$themes)) {
      throw new \Exception('You need to set the protected static $themes property on your test class, with the first item being the default theme.');
    }
    $this->container->get('theme_installer')->install(static::$themes);
    $this->installConfig('system');

    $system_theme_config = $this->container->get('config.factory')->getEditable('system.theme');
    $system_theme_config
      ->set('default', reset(static::$themes))
      ->save();
    $this->negotiator = new ComponentNegotiator(
      \Drupal::service('theme.manager'),
      \Drupal::service('extension.list.module'),
    );
    $this->manager = \Drupal::service('plugin.manager.sdc');
  }

}
Home | Imprint | This part of the site doesn't use cookies.