diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php old mode 100644 new mode 100755 index cbc132f..b07847f --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php @@ -7,10 +7,19 @@ namespace Drupal\field_ui\Tests; +use Drupal\Core\Language\Language; + /** * Tests the functionality of the 'Manage fields' screen. */ class ManageFieldsTest extends FieldUiTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language', 'locale'); + public static function getInfo() { return array( 'name' => 'Manage fields', @@ -472,5 +481,31 @@ function testDeleteTaxonomyField() { // Check that the field was deleted too. $this->assertNull(field_info_field($this->field_name), 'Field was deleted.'); } + + /** + * Test that _field_info_collate_fields() is not localized + */ + function testFieldTranslation() { + $admin_user = $this->drupalCreateUser(array('administer user fields', 'access administration pages')); + $this->drupalLogin($admin_user); + $language = new Language(array('langcode' => 'xx')); + language_save($language); + // Create test source string + $en_string = locale_storage()->createString(array( + 'source' => 'User name and password', + 'context' => $this->randomName(10), + ))->save(); + // Create translation for new string and save it. + $translation = locale_storage()->createTranslation(array( + 'lid' => $en_string->lid, + 'language' => 'xx', + 'translation' => $this->randomString(), + ))->save(); + //check translated strings are avialable in pages. + $this->drupalGet('xx/admin/config/people/accounts/fields'); + $this->assertText($translation->getString(), 'Translated string found.'); + $this->drupalGet('admin/config/people/accounts/fields'); + $this->assertText($en_string->getString(), 'English string found.'); + } }