diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php index 96bf8b2..699509c 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php @@ -54,6 +54,8 @@ protected function doTestBasicTranslation() { $this->assertTrue($entity, 'Entity found in the database.'); $this->drupalGet($entity->getSystemPath()); $this->assertResponse(200, 'Entity URL is valid.'); + $this->drupalGet($entity->getSystemPath('drupal:content-translation-overview')); + $this->assertNoText('Source language', 'Source language column correctly hidden.'); $translation = $this->getTranslation($entity, $default_langcode); foreach ($values[$default_langcode] as $property => $value) { @@ -74,20 +76,27 @@ protected function doTestBasicTranslation() { $this->assertNoFieldByXPath('//select[@id="edit-langcode"]', NULL, 'Language selector correctly disabled on translations.'); } $entity = entity_load($this->entityTypeId, $this->entityId, TRUE); + $this->drupalGet($entity->getSystemPath('drupal:content-translation-overview')); + $this->assertNoText('Source language', 'Source language column correctly hidden.'); // Switch the source language. $langcode = 'fr'; $source_langcode = 'it'; $edit = array('source_langcode[source]' => $source_langcode); $path = $langcode . '/' . $content_translation_path . '/add/' . $default_langcode . '/' . $langcode; + // This does not save anything, it merely reloads the form and fills in the + // fields with the values from the different source language. $this->drupalPostForm($path, $edit, t('Change')); $this->assertFieldByXPath("//input[@name=\"{$this->fieldName}[0][value]\"]", $values[$source_langcode][$this->fieldName][0]['value'], 'Source language correctly switched.'); // Add another translation and mark the other ones as outdated. $values[$langcode] = $this->getNewEntityValues($langcode); $edit = $this->getEditValues($values, $langcode) + array('content_translation[retranslate]' => TRUE); + $path = $langcode . '/' . $content_translation_path . '/add/' . $source_langcode . '/' . $langcode; $this->drupalPostForm($path, $edit, $this->getFormSubmitActionForNewTranslation($entity, $langcode)); $entity = entity_load($this->entityTypeId, $this->entityId, TRUE); + $this->drupalGet($entity->getSystemPath('drupal:content-translation-overview')); + $this->assertText('Source language', 'Source language column correctly shown.'); // Check that the entered values have been correctly stored. foreach ($values as $langcode => $property_values) {