diff --git a/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php b/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php index f11aa3c..1298baf 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,40 @@ class ConfigTranslationListUITest extends WebTestBase { } /** + * Tests the field listing for the translate operation. + */ + function doFieldListTest() { + + // Look at a few fields on a few entity types. + $pages = array( + array( + 'list' => 'admin/structure/types/manage/article/fields', + 'field' => 'node.article.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 +472,7 @@ class ConfigTranslationListUITest extends WebTestBase { $this->doImageStyleListTest(); $this->doPictureListTest(); $this->doDateFormatListTest(); + $this->doFieldListTest(); // Views is tested in Drupal\config_translation\Tests\ConfigTranslationViewListUITest