1 update.test UpdateTestContribCase::testUpdateBaseThemeSecurityUpdate()

Tests that subthemes are notified about security updates for base themes.

File

core/modules/update/tests/update.test, line 400
This file contains tests for the Update Manager module.

Class

UpdateTestContribCase

Code

function testUpdateBaseThemeSecurityUpdate() {
  // Only enable the subtheme, not the base theme.
  db_update('system')
    ->fields(array('status' => 1))
    ->condition('type', 'theme')
    ->condition('name', 'update_test_subtheme')
    ->execute();

  // Define the initial state for core and the subtheme.
  $system_info = array(
    // We want core to be version 1.0.
    '#all' => array(
      'version' => '1.0',
    ),
    // Show the update_test_basetheme
    'update_test_basetheme' => array(
      'project' => 'update_test_basetheme',
      'version' => '1.x-1.0',
      'hidden' => FALSE,
    ),
    // Show the update_test_subtheme
    'update_test_subtheme' => array(
      'project' => 'update_test_subtheme',
      'version' => '1.x-1.0',
      'hidden' => FALSE,
    ),
  );
  state_set('update_test_system_info', $system_info);
  $xml_mapping = array(
    'backdrop' => '0',
    'update_test_subtheme' => '1_0',
    'update_test_basetheme' => '1_1-sec',
  );
  $this->refreshUpdateStatus($xml_mapping);
  $this->assertText(t('Security update required!'));
  $this->assertRaw(l(t('Update test base theme'), 'http://example.com/project/update_test_basetheme'), 'Link to the Update test base theme project appears.');
}