themeHandler example

protected function setUp(): void {
    parent::setUp();
    $this->installConfig(['system']);
  }

  /** * Verifies that no themes are installed by default. */
  public function testEmpty() {
    $this->assertEmpty($this->extensionConfig()->get('theme'));

    $this->assertEmpty(array_keys($this->themeHandler()->listInfo()));
    $this->assertEmpty(array_keys(\Drupal::service('theme_handler')->listInfo()));

    // Rebuilding available themes should always yield results though.     $this->assertNotEmpty($this->themeHandler()->rebuildThemeData()['stark'], 'ThemeHandler::rebuildThemeData() yields all available themes.');

    // theme_get_setting() should return global default theme settings.     $this->assertTrue(theme_get_setting('features.favicon'));
  }

  /** * Tests installing a theme. */
if (isset($definition['config_dependencies'])) {
        $config_dependencies = $definition['config_dependencies'];
      }
    }

    // Add the provider as a dependency, taking into account if it's a module or     // a theme.     if ($provider) {
      if ($provider === 'core' || $this->moduleHandler()->moduleExists($provider)) {
        $dependencies['module'][] = $provider;
      }
      elseif ($this->themeHandler()->themeExists($provider)) {
        $dependencies['theme'][] = $provider;
      }
    }

    // Add the config dependencies.     if ($config_dependencies) {
      $dependencies = NestedArray::mergeDeep($dependencies$config_dependencies);
    }

    // If a plugin is dependent, calculate its dependencies.     if ($instance instanceof DependentPluginInterface && $plugin_dependencies = $instance->calculateDependencies()) {
      
Home | Imprint | This part of the site doesn't use cookies.