diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php index 37100ae..baa3f33 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php @@ -262,13 +262,15 @@ function testUpdateShowDisabledThemes() { } } - /** - * Tests that hidden base themes do not report a specified undefined - * index error in the available updates report. + /** + * Tests updates with a hidden base theme. */ - function testUpdateHiddenBaseThemeError() { + 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. @@ -283,14 +285,41 @@ function testUpdateHiddenBaseThemeError() { ), ); config('update_test.settings')->set('system_info', $system_info)->save(); - $xml_mapping = array( - 'drupal' => '0', - 'update_test_subtheme' => '1_0', - 'update_test_basetheme' => '1_1-sec', + $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.'); + } + + /** + * Tests updates with a hidden base theme. + */ + 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, + ), ); - $this->refreshUpdateStatus($xml_mapping); - $message = t('Notice: Undefined index: update_test_basetheme in theme_update_report()'); - $this->assertNoText(t($message), t('The hidden base theme, update_test_basetheme, did not produce error message: !message', array('!message' => $message))); + 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.'); } /**