commit 09695ce99901c17d7970eb39a70ac9768cb3f39e Author: Erik Stielstra Date: Fri Sep 12 10:10:45 2014 +0200 #67 diff --git a/core/modules/locale/src/Tests/LocaleUpdateBase.php b/core/modules/locale/src/Tests/LocaleUpdateBase.php index 44f34c2..c7f6233 100644 --- a/core/modules/locale/src/Tests/LocaleUpdateBase.php +++ b/core/modules/locale/src/Tests/LocaleUpdateBase.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\locale\Tests\LocaleUpdateTest. + * Contains Drupal\locale\Tests\LocaleUpdateBase. */ namespace Drupal\locale\Tests; @@ -42,13 +42,19 @@ * * @var array */ - public static $modules = array('update', 'locale', 'locale_test'); + public static $modules = array('update', 'update_test', 'locale', 'locale_test',); /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); + + // Update module should not go out to d.o to check for updates. We override + // the url to the default update_test xml path. But without providing + // a mock xml file, no update data will be found. + \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); + // Setup timestamps to identify old and new translation sources. $this->timestampOld = REQUEST_TIME - 300; $this->timestampMedium = REQUEST_TIME - 200; diff --git a/core/modules/locale/tests/modules/locale_test/locale_test.module b/core/modules/locale/tests/modules/locale_test/locale_test.module index f06a24a..d9fd382 100644 --- a/core/modules/locale/tests/modules/locale_test/locale_test.module +++ b/core/modules/locale/tests/modules/locale_test/locale_test.module @@ -40,6 +40,11 @@ function locale_test_system_info_alter(&$info, Extension $file, $type) { * test script in order for this hook to take effect. */ function locale_test_locale_translation_projects_alter(&$projects) { + // Drupal core should not be translated. By overriding the server pattern we + // make sure that no translation for drupal core will be found and that the + // translation update system will not go out to l.d.o to check. + $projects['drupal']['server_pattern'] = 'translations://'; + if (\Drupal::state()->get('locale.test_projects_alter')) { // Instead of the default ftp.drupal.org we use the file system of the test