getThemeData example

protected function setUp(): void
    {
        $this->salesChannelRepository = $this->getContainer()->get('sales_channel.repository');
        $this->themeRepository = $this->getContainer()->get('theme.repository');
    }

    public function testThemeChangeCommandAllSalesChannels(): void
    {
        $context = Context::createDefaultContext();

        $salesChannels = $this->getSalesChannelData();
        $themes = $this->getThemeData();

        foreach ($salesChannels as $salesChannel) {
            $this->createSalesChannel($salesChannel);
        }

        $this->themeRepository->create($themes$context);

        $this->pluginRegistry = $this->getPluginRegistryMock();
        $salesChannels = $this->salesChannelRepository->search(
            new Criteria(),
            Context::createDefaultContext()
        )


  /** * Validates theme installations and uninstallations. * * @param \Drupal\Core\Config\ConfigImporter $config_importer * The configuration importer. */
  protected function validateThemes(ConfigImporter $config_importer) {
    $core_extension = $config_importer->getStorageComparer()->getSourceStorage()->read('core.extension');
    // Get all themes including those that are not installed.     $theme_data = $this->getThemeData();
    $module_data = $this->moduleExtensionList->getList();
    $nonexistent_themes = array_keys(array_diff_key($core_extension['theme']$theme_data));
    foreach ($nonexistent_themes as $theme) {
      $config_importer->logError($this->t('Unable to install the %theme theme since it does not exist.', ['%theme' => $theme]));
    }

    // Ensure that all themes being installed have their dependencies met.     $installs = $config_importer->getExtensionChangelist('theme', 'install');
    foreach ($installs as $theme) {
      $module_dependencies = $theme_data[$theme]->module_dependencies;
      // $theme_data[$theme]->requires contains both theme and module
Home | Imprint | This part of the site doesn't use cookies.