You are here

public function ThemeInfoTest::testChanges in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Theme/ThemeInfoTest.php \Drupal\system\Tests\Theme\ThemeInfoTest::testChanges()

Tests that changes to the info file are picked up.

File

core/modules/system/src/Tests/Theme/ThemeInfoTest.php, line 90
Contains \Drupal\system\Tests\Theme\ThemeInfoTest.

Class

ThemeInfoTest
Tests processing of theme .info.yml properties.

Namespace

Drupal\system\Tests\Theme

Code

public function testChanges() {
  $this->themeHandler
    ->install(array(
    'test_theme',
  ));
  $this->themeHandler
    ->setDefault('test_theme');
  $this->themeManager
    ->resetActiveTheme();
  $active_theme = $this->themeManager
    ->getActiveTheme();

  // Make sure we are not testing the wrong theme.
  $this
    ->assertEqual('test_theme', $active_theme
    ->getName());
  $this
    ->assertEqual([
    'classy/base',
    'core/normalize',
    'test_theme/global-styling',
  ], $active_theme
    ->getLibraries());

  // @see theme_test_system_info_alter()
  $this->state
    ->set('theme_test.modify_info_files', TRUE);
  drupal_flush_all_caches();
  $active_theme = $this->themeManager
    ->getActiveTheme();
  $this
    ->assertEqual([
    'classy/base',
    'core/normalize',
    'test_theme/global-styling',
    'core/backbone',
  ], $active_theme
    ->getLibraries());
}