diff options
author | Nathaniel Catchpole | 2018-05-09 13:24:58 (GMT) |
---|---|---|
committer | Nathaniel Catchpole | 2018-05-09 13:24:58 (GMT) |
commit | 2129484ee5813d97a5159f10601e0048d3b73293 (patch) | |
tree | 1a99deafef79afa30a468547fa1a0cf56fbfdd4b | |
parent | 7a4a8c97c2ecb6cf67013305663167e05de920d2 (diff) |
Issue #2828143 by alexpott, klausi, xjm: Stop tests like LocaleConfigTranslationImportTest from failing if l.d.o becomes unavailable
7 files changed, 11 insertions, 7 deletions
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php index bbaace2..20ee969 100644 --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php @@ -79,6 +79,7 @@ class ConfigTranslationListUiTest extends BrowserTestBase { // tests. $this->config('locale.settings') ->set('translation.import_enabled', TRUE) + ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL) ->save(); $this->drupalPlaceBlock('local_tasks_block'); } diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php index 82f7e2f..84faaec 100644 --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php @@ -807,6 +807,7 @@ class ConfigTranslationUiTest extends BrowserTestBase { // tests. $this->config('locale.settings') ->set('translation.import_enabled', TRUE) + ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL) ->save(); $this->drupalLogin($this->adminUser); diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php index df7a5ff..2550031 100644 --- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php @@ -25,11 +25,6 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase { */ protected function setUp() { parent::setUp(); - - // @todo Re-enable the test and only skip it when the translation cannot be - // downloaded, or provide a translation as a fixture instead. See - // https://www.drupal.org/project/drupal/issues/2828143. - $this->markTestSkipped(); } /** @@ -51,6 +46,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase { // tests. $this->config('locale.settings') ->set('translation.import_enabled', TRUE) + ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL) ->save(); // Add translation permissions now that the locale module has been enabled. @@ -96,6 +92,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase { // tests. $this->config('locale.settings') ->set('translation.import_enabled', TRUE) + ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL) ->save(); // Add predefined language. @@ -154,6 +151,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase { // tests. $this->config('locale.settings') ->set('translation.import_enabled', TRUE) + ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL) ->save(); // Add predefined language. @@ -191,6 +189,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase { // tests. $this->config('locale.settings') ->set('translation.import_enabled', TRUE) + ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL) ->save(); // Add predefined language. diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php index a2cdefb..3d6c950 100644 --- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php @@ -38,6 +38,7 @@ class LocaleConfigTranslationTest extends BrowserTestBase { // tests. $this->config('locale.settings') ->set('translation.import_enabled', TRUE) + ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL) ->save(); // Add custom language. diff --git a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php index 581c98f..c63c4e4 100644 --- a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php @@ -52,6 +52,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase { // tests. $this->config('locale.settings') ->set('translation.import_enabled', TRUE) + ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL) ->save(); } diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php index 2a59248..1a5debf 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php @@ -63,6 +63,7 @@ abstract class LocaleUpdateBase extends BrowserTestBase { // tests. $this->config('locale.settings') ->set('translation.import_enabled', TRUE) + ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL) ->save(); } diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php index 2e7add6..99e3a2c 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php @@ -84,7 +84,7 @@ class LocaleUpdateCronTest extends LocaleUpdateBase { // Check whether tasks are added to the queue. $queue = \Drupal::queue('locale_translation', TRUE); - $this->assertEqual($queue->numberOfItems(), 3, 'Queue holds tasks for one project.'); + $this->assertEqual($queue->numberOfItems(), 2, 'Queue holds tasks for one project.'); $item = $queue->claimItem(); $queue->releaseItem($item); $this->assertEqual($item->data[1][0], 'contrib_module_two', 'Queue holds tasks for contrib module one.'); @@ -95,7 +95,7 @@ class LocaleUpdateCronTest extends LocaleUpdateBase { // Check whether no more tasks are added to the queue. $queue = \Drupal::queue('locale_translation', TRUE); - $this->assertEqual($queue->numberOfItems(), 3, 'Queue holds tasks for one project.'); + $this->assertEqual($queue->numberOfItems(), 2, 'Queue holds tasks for one project.'); // Ensure last checked is updated to a greater time than the initial value. sleep(1); |