function UpdateContribTest::testUpdateHiddenBaseTheme

Tests updates with a hidden base theme.

File

drupal/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php, line 268
Definition of Drupal\update\Tests\UpdateContribTest.

Class

UpdateContribTest
Tests behavior related to handling updates to contributed modules and themes.

Namespace

Drupal\update\Tests

Code

function testUpdateHiddenBaseTheme() {
  module_load_include('compare.inc', 'update');

  // Enable the subtheme.
  theme_enable(array(
    'update_test_subtheme',
  ));

  // Add a project and initial state for base theme and subtheme.
  $system_info = array(
    // Hide the update_test_basetheme.
    'update_test_basetheme' => array(
      'project' => 'update_test_basetheme',
      'hidden' => TRUE,
    ),
    // Show the update_test_subtheme.
    'update_test_subtheme' => array(
      'project' => 'update_test_subtheme',
      'hidden' => FALSE,
    ),
  );
  config('update_test.settings')
    ->set('system_info', $system_info)
    ->save();
  $projects = update_get_projects();
  $theme_data = system_rebuild_theme_data();
  update_process_info_list($projects, $theme_data, 'theme', TRUE);
  $this
    ->assertTrue(!empty($projects['update_test_basetheme']), 'Valid base theme (update_test_basetheme) was found.');
}