diff --git a/lib/Drupal/config_translation/Tests/ConfigTranslationUITest.php b/lib/Drupal/config_translation/Tests/ConfigTranslationUITest.php index 0a5b6be..8843432 100644 --- a/lib/Drupal/config_translation/Tests/ConfigTranslationUITest.php +++ b/lib/Drupal/config_translation/Tests/ConfigTranslationUITest.php @@ -27,7 +27,7 @@ class ConfigTranslationUITest extends WebTestBase { * * @var array */ - protected $languages = array('fr', 'ta'); + protected $langcodes = array('fr', 'ta'); public static function getInfo() { return array( @@ -51,7 +51,7 @@ class ConfigTranslationUITest extends WebTestBase { $this->drupalLogin($admin_user); // Add languages. - foreach ($this->languages as $langcode) { + foreach ($this->langcodes as $langcode) { $edit = array( 'predefined_langcode' => $langcode, ); @@ -166,7 +166,7 @@ class ConfigTranslationUITest extends WebTestBase { } /** - * Test case for site information translation interface. + * Test case for Contact category translation. */ function testContactConfigEntityTranslation() { $this->drupalGet('admin/structure/contact'); @@ -174,18 +174,19 @@ class ConfigTranslationUITest extends WebTestBase { // Check for default contact form config entity from Contact module. $this->assertLinkByHref('admin/structure/contact/manage/feedback/edit'); - // Visit page to check to update details and check for translation tab. - $this->assertLinkByHref('admin/structure/contact/manage/feedback/edit'); - // Save default language configuration. $edit = array( - 'label' => 'Website feedback', + 'label' => 'Send your feedback', 'recipients' => 'sales@example.com,support@example.com', 'reply' => 'Thank you for your mail' ); $this->drupalPost('admin/structure/contact/manage/feedback/edit', $edit, t('Save')); - foreach ($this->languages as $langcode) { + // Visit the form to confirm the changes. + $this->drupalGet('contact/feedback'); + $this->assertText('Send your feedback'); + + foreach ($this->langcodes as $langcode) { // Update translatable fields. $edit = array( '0[label]' => 'Website feedback - ' . $langcode, @@ -206,13 +207,13 @@ class ConfigTranslationUITest extends WebTestBase { ); $this->drupalPost(NULL, $edit, t('Send message')); } - // Keep it out of loop, as state() capture all emails. + // We get all emails so no need to check inside the loop. $captured_emails = $this->drupalGetMails(); // Check language specific auto reply text in email body. foreach ($captured_emails as $email) { if ($email['id'] == 'contact_page_autoreply') { - // Needs trim as getting new line at end. + // Trim because we get an added newline for the body. $this->assertEqual(trim($email['body']), 'Thank you for your mail - ' . $email['langcode']); } }