From 29045807f88c4c99e53e65bef6159eb557be7d87 Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy Date: Tue, 20 Jun 2017 15:34:16 +0200 Subject: [PATCH] Issue #2870441 by naveenvalecha, dawehner, Lendude: Convert web tests to browser tests for content_translation module --- .../src/Functional}/ContentTestTranslationUITest.php | 2 +- .../ContentTranslationDisableSettingTest.php | 2 +- .../src/Functional}/ContentTranslationEnableTest.php | 10 +++++----- .../ContentTranslationLanguageChangeTest.php | 2 +- .../src/Functional}/ContentTranslationSettingsTest.php | 8 ++++---- .../Functional}/ContentTranslationSyncImageTest.php | 7 ++++++- .../src/Functional}/Views/TranslationLinkTest.php | 4 ++-- 7 files changed, 20 insertions(+), 15 deletions(-) rename core/modules/content_translation/{src/Tests => tests/src/Functional}/ContentTestTranslationUITest.php (93%) rename core/modules/content_translation/{src/Tests => tests/src/Functional}/ContentTranslationDisableSettingTest.php (96%) rename core/modules/content_translation/{src/Tests => tests/src/Functional}/ContentTranslationEnableTest.php (88%) rename core/modules/content_translation/{src/Tests => tests/src/Functional}/ContentTranslationLanguageChangeTest.php (98%) rename core/modules/content_translation/{src/Tests => tests/src/Functional}/ContentTranslationSettingsTest.php (98%) rename core/modules/content_translation/{src/Tests => tests/src/Functional}/ContentTranslationSyncImageTest.php (98%) rename core/modules/content_translation/{src/Tests => tests/src/Functional}/Views/TranslationLinkTest.php (92%) diff --git a/core/modules/content_translation/src/Tests/ContentTestTranslationUITest.php b/core/modules/content_translation/tests/src/Functional/ContentTestTranslationUITest.php similarity index 93% rename from core/modules/content_translation/src/Tests/ContentTestTranslationUITest.php rename to core/modules/content_translation/tests/src/Functional/ContentTestTranslationUITest.php index 1688f75fd6b..0b1de0b204f 100644 --- a/core/modules/content_translation/src/Tests/ContentTestTranslationUITest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTestTranslationUITest.php @@ -1,6 +1,6 @@ drupalGet('admin/reports/status'); $requirement_value = $this->cssSelect("details.system-status-report__entry summary:contains('Entity/field definitions') + div"); - $this->assertEqual(t('Up to date'), trim((string) $requirement_value[0])); + $this->assertEqual(t('Up to date'), trim($requirement_value[0]->getText())); $this->drupalGet('admin/config/regional/content-language'); // The node entity type should not be an option because it has no bundles. @@ -54,7 +54,7 @@ class ContentTranslationEnableTest extends WebTestBase { // No pending updates should be available. $this->drupalGet('admin/reports/status'); $requirement_value = $this->cssSelect("details.system-status-report__entry summary:contains('Entity/field definitions') + div"); - $this->assertEqual(t('Up to date'), trim((string) $requirement_value[0])); + $this->assertEqual(t('Up to date'), trim($requirement_value[0]->getText())); // Create a node type and check the content translation settings are now // available for nodes. diff --git a/core/modules/content_translation/src/Tests/ContentTranslationLanguageChangeTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php similarity index 98% rename from core/modules/content_translation/src/Tests/ContentTranslationLanguageChangeTest.php rename to core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php index 04bd023cde1..ae326ef67b8 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationLanguageChangeTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php @@ -1,6 +1,6 @@ xpath('//select[@id="edit-settings-node-article-settings-language-langcode"]/option'); // Compare values inside the option elements with expected values. for ($i = 0; $i < count($elements); $i++) { - $this->assertEqual($elements[$i]->attributes()->{'value'}, $expected_elements[$i]); + $this->assertEqual($elements[$i]->getValue(), $expected_elements[$i]); } } diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php similarity index 98% rename from core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php rename to core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php index 30ff32de522..5f7c9fd9b8e 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php @@ -1,11 +1,12 @@