diff --git a/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php b/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php index 659ff39..8e46273 100644 --- a/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php +++ b/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php @@ -33,6 +33,9 @@ class ConfigTranslationListUITest extends WebTestBase { 'taxonomy', 'image', 'picture', + 'node', + 'field', + 'field_ui', ); public static function getInfo() { @@ -69,6 +72,8 @@ class ConfigTranslationListUITest extends WebTestBase { 'administer image styles', 'administer pictures', 'translate configuration', + 'administer custom_block fields', + 'administer node fields', ); // Create and log in user. @@ -379,6 +384,47 @@ class ConfigTranslationListUITest extends WebTestBase { } /** + * Tests the field listing for the translate operation. + */ + function doFieldListTest() { + + // Create a base content type. + $content_type = entity_create('node_type', array( + 'type' => Unicode::strtolower($this->randomName(16)), + 'name' => $this->randomName(), + )); + $content_type->save(); + + // Look at a few fields on a few entity types. + $pages = array( + array( + 'list' => 'admin/structure/types/manage/' . $content_type->id() . '/fields', + 'field' => 'node.' . $content_type->id() . '.body', + ), + array( + 'list' => 'admin/structure/custom-blocks/manage/basic/fields', + 'field' => 'custom_block.basic.block_body', + ), + ); + + foreach ($pages as $values) { + // Get fields listing. + $this->drupalGet($values['list']); + // @todo remove this once the test below works. + $this->assertText(t('Translate')); + + $translate_link = $values['list'] . '/' . $values['field'] . '/translate'; + // Test if the link to translate the field is on the page. + $this->assertLinkByHref($translate_link); + + // Test if the link to translate actually goes to the translate page. + $this->drupalGet($translate_link); + $this->assertRaw('' . t('Language') . ''); + } + + } + + /** * Tests the date format listing for the translate operation. */ function doDateFormatListTest() { @@ -433,6 +479,7 @@ class ConfigTranslationListUITest extends WebTestBase { $this->doImageStyleListTest(); $this->doPictureListTest(); $this->doDateFormatListTest(); + $this->doFieldListTest(); // Views is tested in Drupal\config_translation\Tests\ConfigTranslationViewListUITest