diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php index fd0b6cf..e3b6777 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php @@ -474,8 +474,7 @@ function testStringSearch() { } /** - * Test that strings are only saved and marked as customized when they are - * actually changed. + * Tests that only changed strings are saved customized when edited. */ function testUICustomizedStrings(){ $user = $this->drupalCreateUser(array('translate interface', 'administer languages', 'access administration pages')); @@ -500,7 +499,7 @@ function testUICustomizedStrings(){ // Reset locale cache. locale_reset(); - // Queries strings with showing only non-customized strings. + // Ensure non-customized translation string does appear if searching Non-customized translation. $search = array( 'string' => $string->getString(), 'langcode' => 'de', @@ -511,8 +510,7 @@ function testUICustomizedStrings(){ $source = $this->assertText($translation->getString(), 'Translation is found in search result.'); - // Submitting the translations withouth changing the translation, so the - // translation should not be saved and still be returned as non-customized. + // Submit the translations without changing the translation. $textarea = current($this->xpath('//textarea')); $lid = (string) $textarea[0]['name']; $edit = array( @@ -520,10 +518,17 @@ function testUICustomizedStrings(){ ); $this->drupalPost('admin/config/regional/translate/translate', $edit, t('Save translations')); - $source = $this->assertText($translation->getString(), 'Translation still marked as non-customized.'); + // Ensure unchanged translation string does appear if searching non-customized translation. + $search = array( + 'string' => $string->getString(), + 'langcode' => 'de', + 'translation' => 'translated', + 'customized' => '0', + ); + $this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter')); + $source = $this->assertText($string->getString(), 'Translation is not marked as customized.'); - // Submitting the translations with a new the translation, so the - // translation will be saved as customized and no result will be returned. + // Submit the translations with a new translation. $textarea = current($this->xpath('//textarea')); $lid = (string) $textarea[0]['name']; $edit = array( @@ -531,6 +536,14 @@ function testUICustomizedStrings(){ ); $this->drupalPost('admin/config/regional/translate/translate', $edit, t('Save translations')); - $this->assertText(t('No strings available.'), "No result anymore, so the string has been saved as customized."); + // Ensure changed translation string does appear if searching customized translation. + $search = array( + 'string' => $string->getString(), + 'langcode' => 'de', + 'translation' => 'translated', + 'customized' => '1', + ); + $this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter')); + $this->assertText($string->getString(), "Translation is marked as customized."); } }