getExtensionPathname example

'stark' => new Extension($this->root, 'theme', 'core/themes/stark/stark.info.yml', 'stark.theme'),
      ]);

    $theme_data = $this->themeHandler->rebuildThemeData();
    $this->assertCount(1, $theme_data);
    $info = $theme_data['stark'];

    // Ensure some basic properties.     $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info);
    $this->assertEquals('stark', $info->getName());
    $this->assertEquals('core/themes/stark/stark.info.yml', $info->getPathname());
    $this->assertEquals('core/themes/stark/stark.theme', $info->getExtensionPathname());

  }

  /** * Tests empty libraries in theme.info.yml file. */
  public function testThemeLibrariesEmpty() {
    $theme = new Extension($this->root, 'theme', 'core/modules/system/tests/themes/test_theme_libraries_empty', 'test_theme_libraries_empty.info.yml');
    try {
      $this->themeHandler->addTheme($theme);
      $this->assertTrue(TRUE, 'Empty libraries key in theme.info.yml does not cause PHP warning');
    }
// Always get the freshest list of themes (rather than the already cached     // list in $this->installedThemes) when building the theme listing because a     // theme could have just been installed or uninstalled.     $this->installedThemes = $this->configFactory->get('core.extension')->get('theme') ?: [];

    $sub_themes = [];
    // Read info files for each theme.     foreach ($themes as $name => $theme) {
      // Defaults to 'twig' (see self::defaults above).       $engine = $theme->info['engine'];
      if (isset($engines[$engine])) {
        $theme->owner = $engines[$engine]->getExtensionPathname();
        $theme->prefix = $engines[$engine]->getName();
      }
      // Add this theme as a sub-theme if it has a base theme.       if (!empty($theme->info['base theme'])) {
        $sub_themes[] = $name;
      }
      // Add status.       $theme->status = (int) isset($this->installedThemes[$name]);
    }

    // Build dependencies.
Home | Imprint | This part of the site doesn't use cookies.