function UpdateContribTest::testUpdateHiddenBaseTheme
Tests updates with a hidden base theme.
File
- 
              core/modules/ update/ tests/ src/ Functional/ UpdateContribTest.php, line 404 
Class
- UpdateContribTest
- Tests how the Update Manager handles contributed modules and themes.
Namespace
Drupal\Tests\update\FunctionalCode
public function testUpdateHiddenBaseTheme() : void {
  \Drupal::moduleHandler()->loadInclude('update', 'inc', 'update.compare');
  // Install the subtheme.
  \Drupal::service('theme_installer')->install([
    'update_test_subtheme',
  ]);
  // Add a project and initial state for base theme and subtheme.
  $this->mockInstalledExtensionsInfo([
    // Hide the update_test_basetheme.
'update_test_basetheme' => [
      'project' => 'update_test_basetheme',
      'hidden' => TRUE,
    ],
    // Show the update_test_subtheme.
'update_test_subtheme' => [
      'project' => 'update_test_subtheme',
      'hidden' => FALSE,
    ],
  ]);
  $projects = \Drupal::service('update.manager')->getProjects();
  $theme_data = \Drupal::service('extension.list.theme')->reset()
    ->getList();
  $project_info = new ProjectInfo();
  $project_info->processInfoList($projects, $theme_data, 'theme', TRUE);
  $this->assertNotEmpty($projects['update_test_basetheme'], 'Valid base theme (update_test_basetheme) was found.');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
