You are here

public function L10nUpdateTest::testUpdateProjects in Localization update 7.2

Checks if a list of translatable projects gets build.

File

tests/L10nUpdateTest.test, line 52
Contains L10nUpdateTest.

Class

L10nUpdateTest
Tests for update translations.

Code

public function testUpdateProjects() {
  module_load_include('compare.inc', 'l10n_update');
  variable_set('l10n_update_test_projects_alter', TRUE);

  // Make the test modules look like a normal custom module. i.e. make the
  // modules not hidden. l10n_update_test_system_info_alter() modifies the
  // project info of the l10n_update_test and l10n_update_test_translate
  // modules.
  variable_set('l10n_update_test_system_info_alter', TRUE);
  $this
    ->resetAll();

  // Check if interface translation data is collected from hook_info.
  $projects = l10n_update_project_list();
  $this
    ->assertFalse(isset($projects['l10n_update_test_translate']), 'Hidden module not found');
  $this
    ->assertEqual($projects['l10n_update_test']['info']['l10n path'], drupal_get_path('module', 'l10n_update') . '/tests/test.%language.po', 'l10n path parameter found in project info.');
  $this
    ->assertEqual($projects['l10n_update_test']['name'], 'l10n_update_test', format_string('%key found in project info.', array(
    '%key' => 'interface translation project',
  )));
}