diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleCompareUnitTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleCompareUnitTest.php index 604718d..27cd348 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleCompareUnitTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleCompareUnitTest.php @@ -42,18 +42,16 @@ class LocaleCompareUnitTest extends WebTestBase { $projects = locale_translation_project_list(); $this->assertFalse(isset($projects['locale_test']), t('Hidden module not found')); - // Make the test modules look like a normal custom module. i.e. the module - // is not hidden. locale_test_system_info_alter() modifies the project info - // of the locale_test and locale_test_disabled modules. + // Make the test modules look like a normal custom module. i.e. make the + // modules not hidden. locale_test_system_info_alter() modifies the project + // info of the locale_test and locale_test_disabled modules. variable_set('locale_translation_test_system_info_alter', TRUE); - // Check if interface translation data is collected from .info file. + // Check if interface translation data is collected from hook_info. drupal_static_reset('locale_translation_project_list'); $projects = locale_translation_project_list(); - $this->assertEqual($projects['locale_test']['info']['interface translation server url'], 'http://locale_example.com/files/translations/l10n_server.xml', t('%key found in project info.', array('%key' => 'interface translation url'))); - $this->assertEqual($projects['locale_test']['info']['interface translation server pattern'], 'http://locale_example.com/files/translations/%core/%project/%project-%release.%language.po', t('%key found in project info.', array('%key' => 'interface translation server pattern'))); + $this->assertEqual($projects['locale_test']['info']['interface translation server pattern'], 'core/modules/locale/test/modules/locale_test/%project-%version.%language.po', t('Interface translation parameter found in project info.')); $this->assertEqual($projects['locale_test']['name'] , 'locale_test', t('%key found in project info.', array('%key' => 'interface translation project'))); - $this->assertFalse(isset($projects['locale_test_disabled']), t('Disabled module not found')); // Check if disabled modules are detected. variable_set('locale_translation_check_disabled', TRUE); @@ -61,14 +59,14 @@ class LocaleCompareUnitTest extends WebTestBase { $projects = locale_translation_project_list(); $this->assertTrue(isset($projects['locale_test_disabled']), t('Disabled module found')); - // Check the fully processed list of project data of both - // enabled and disabled modules. + // Check the fully processed list of project data of both enabled and + // disabled modules. variable_set('locale_translation_check_disabled', TRUE); drupal_static_reset('locale_translation_project_list'); $projects = locale_translation_get_projects(); $this->assertEqual($projects['drupal']->name, 'drupal', t('Core project found')); - $this->assertEqual($projects['locale_test']->server_url, 'http://locale_example.com/files/translations/l10n_server.xml', t('Server data for custom module found.')); - $this->assertEqual($projects['locale_test_disabled']->status, 0, t('Disabled module found')); + $this->assertEqual($projects['locale_test']->server_pattern, 'core/modules/locale/test/modules/locale_test/%project-%version.%language.po', t('Interface translation parameter found in project info.')); + $this->assertEqual($projects['locale_test_disabled']->status, '0', t('Disabled module found')); variable_del('locale_translation_check_disabled'); // Return the locale test modules back to their hidden state. diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index 8c35be1..0b0ef65 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -359,6 +359,7 @@ function locale_translation_translation_servers($name = NULL, $url = NULL, $refr } } // Now fetch server meta information form the server itself. + module_load_include('fetch.inc', 'locale'); if ($server = locale_translation_get_server($server)) { cache('locale')->set($cid, $server); $info[$url] = $server; diff --git a/core/modules/locale/locale.fetch.inc b/core/modules/locale/locale.fetch.inc deleted file mode 100644 index 8f6d01c..0000000 --- a/core/modules/locale/locale.fetch.inc +++ /dev/null @@ -1,9 +0,0 @@ - 'module', + 'info' => array( + 'project' => 'locale_test', + 'interface translation server pattern' => 'core/modules/locale/test/modules/locale_test/%project-%version.%language.po', + ), + ); + + return $projects; +} diff --git a/core/modules/locale/tests/modules/locale_test_disabled/locale_test_disabled.info b/core/modules/locale/tests/modules/locale_test_disabled/locale_test_disabled.info index 249e855..9c0c04f 100644 --- a/core/modules/locale/tests/modules/locale_test_disabled/locale_test_disabled.info +++ b/core/modules/locale/tests/modules/locale_test_disabled/locale_test_disabled.info @@ -4,6 +4,4 @@ package = Testing version = VERSION core = 8.x hidden = TRUE - -; Definitions for interface translations. -interface translation project = locale_test_disabled +project = locale_test_disabled diff --git a/core/modules/locale/tests/modules/locale_test_disabled/locale_test_disabled.module b/core/modules/locale/tests/modules/locale_test_disabled/locale_test_disabled.module index 9d9cab3..5ceb07b 100644 --- a/core/modules/locale/tests/modules/locale_test_disabled/locale_test_disabled.module +++ b/core/modules/locale/tests/modules/locale_test_disabled/locale_test_disabled.module @@ -2,7 +2,6 @@ /** * @file - * Nothing to do here. - * This is just a disabled module for the locale test script. + * Simulate a disabled contrib for Locale test scripts. + * Further, nothing to do here. */ -