diff --git a/config_translation.module b/config_translation.module index 7a6e503..a533e5e 100644 --- a/config_translation.module +++ b/config_translation.module @@ -204,6 +204,9 @@ function config_translation_config_translation_group_info() { // Contact. $items[] = new ConfigEntityMapper('admin/structure/contact/manage/{contact_category}', 'contact_category', t('@label contact category')); + // Content types. + $items[] = new ConfigEntityMapper('admin/structure/types/manage/{node_type}', 'node_type', t('@label content type'), MENU_CALLBACK); + // Date format. $items[] = new ConfigEntityMapper('admin/config/regional/date-time/formats/manage/{date_format}', 'date_format', t('@label date format')); @@ -254,9 +257,6 @@ function config_translation_config_translation_group_info() { // Views. $items[] = new ConfigEntityMapper('admin/structure/views/view/{view}', 'view', t('@label view'), MENU_CALLBACK); - // Content types. - $items[] = new ConfigEntityMapper('admin/structure/types/manage/{node_type}', 'node_type', t('@label content type'), MENU_CALLBACK); - return $items; } diff --git a/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php b/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php index 02607a4..bb53482 100644 --- a/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php +++ b/lib/Drupal/config_translation/Tests/ConfigTranslationListUITest.php @@ -57,6 +57,7 @@ class ConfigTranslationListUITest extends WebTestBase { 'access site-wide contact form', 'administer blocks', 'administer contact forms', + 'administer content types', 'administer filters', 'administer menu', 'administer permissions', @@ -223,6 +224,31 @@ class ConfigTranslationListUITest extends WebTestBase { $this->assertRaw('' . t('Language') . ''); } + + /** + * Tests the content type listing for the translate operation. + */ + function doContentTypeListTest() { + // Create a test content type to decouple looking for translate operations + // link so this does not test more than necessary. + $content_type = entity_create('node_type', array( + 'type' => Unicode::strtolower($this->randomName(16)), + 'name' => $this->randomName(), + )); + $content_type->save(); + + // Get the content type listing. + $this->drupalGet('admin/structure/types'); + + $translate_link = 'admin/structure/types/manage/' . $content_type->id() . '/translate'; + // Test if the link to translate the content type 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 formats listing for the translate operation. */ @@ -401,6 +427,7 @@ class ConfigTranslationListUITest extends WebTestBase { $this->doVocabularyListTest(); $this->doCustomBlockTypeListTest(); $this->doContactFormsListTest(); + $this->doContentTypeListTest(); $this->doFormatsListTest(); $this->doShortcutListTest(); $this->doUserRoleListTest();